Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Question on perl script.

Reply
Thread Tools

Question on perl script.

 
 
Unix_Shell
Guest
Posts: n/a
 
      03-29-2005
Hello Group,

I am very new to the perl language and don't know much about it. I had
a question & maybe someone can help me decipher/modify a script.

We have AIX 5.2 & the script (test.sh) contains the following perl
command:

/usr/bin/perl
-014pe's|^|"'$PAGE1FORM'".(/Page:\s+1\s/?"\n":"'$CONTFORMSFX'\n")|e'

Basically, two values are being passed to this script. Variable
PAGE1FORM will contain $1 (example: "m_inv01") and CONTFORMSFX will
contain $2 (example: "_09").

Basically, the script is invoked as follows:

../test.sh m_inv01 _09 < inrptfile > outrptfile

The perl command processes the inrptfile by substituting the first line
of page 1 with m_inv01 and substituting the first line from page 2
onwards with m_inv01_09 (concatenation of $1 & $2).

Question: How can I make it substitute something completely different
from page 2 onwards? So, if I run the script as follows:

../test.sh m_inv01 pg2form < inrptfile > outrptfile

I would like the perl command to substitute the first line of page 1
with m_inv01 (just like above); however I would like it to substitute
the first line from page 2 onwards with pg2form (i.e. with whatever I
pass as $2 and *not* a concatenation of $1 and $2).

Thanks for any help.
S

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 04-04-2011 10:00 PM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 02-27-2011 11:00 PM
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments