Re: [Perl-unix-users] manipulating/parsing string data

2006-05-30 Thread Joi Ellis
On Tue, 30 May 2006, listmail wrote: Untested, off-the-cuff suggestion... This looks suspiciously like a homework assignment. ;) > #!/usr/local/bin/perl -w > use strict; > > my @data = ('NUMBERS: ONE TWO THREE', > 'WORDS: CAT MOUSE DOG'); > my (@numlist, @wordlist); > > foreach my

Re: [Perl-unix-users] @INC Path problem

2006-05-30 Thread Joi Ellis
On Tue, 30 May 2006, Cai, Lucy (L.) wrote: > When I run the command, I got the following message: > > [EMAIL PROTECTED]:~/test_ooo/vobs/na_mscs_12836sas_deploy> sudo -u prxpccsv > /ccstore > /fmcc/triggers/ApplyVobTriggers.pl > Password: > Empty compile time value given to use lib at > /ccstore/

[Perl-unix-users] manipulating/parsing string data

2006-05-30 Thread listmail
#!/usr/local/bin/perl -w use strict; my @data = ('NUMBERS: ONE TWO THREE', 'WORDS: CAT MOUSE DOG'); my (@numlist, @wordlist); foreach my $line (@data) { print "$line\n"; if ($line =~ /^NUMBERS:/) { # #Need to shift $line so $line becomes onl

RE: [Perl-unix-users] @INC Path problem

2006-05-30 Thread Peter Eisengrein
> > How can I add a path /ccstore/fmcc/triggers/ into @INC path? > There are at least two ways I know of. I'd generally use the first one unless package lib is unavailable on your machine. use lib '/ccstore/fmcc/triggers/'; --OR-- BEGIN { push(@INC,'/ccstore/fmcc/triggers/'); } __

[Perl-unix-users] @INC Path problem

2006-05-30 Thread Cai, Lucy \(L.\)
When I run the command, I got the following message: [EMAIL PROTECTED]:~/test_ooo/vobs/na_mscs_12836sas_deploy> sudo -u prxpccsv /ccstore /fmcc/triggers/ApplyVobTriggers.pl Password: Empty compile time value given to use lib at /ccstore/fmcc/triggers/ApplyVobTrig gers.pl line 25 Can't locate Trigg

Re: [Perl-unix-users] How to modify $ENV{PATH} portably?

2006-05-30 Thread Aleksandar Jelenak
Arijit Das wrote on 05/30/2006 02:51 AM: I need to search for "/dir2/bin" path component in my $ENV{PATH}, and then, insert "/newpath/bin" just before "/dir2/bin". [...] Is there any Perl Array (somewhat like @INC) which I can modify to have my PATH changed? Maybe this CPAN module can help you:

[Perl-unix-users] Re: How to modify $ENV{PATH} portably?

2006-05-30 Thread $Bill Luebkert
Arijit Das wrote: > Hi, > > The format of env variable PATH seems to change with > OS/shell. For example, > in sh it is like > > "/dir1/bin:/dir2/bin:." > > while in csh, it is like > > (/dir1/bin /dir2/bin .) > > I need to search for "/dir2/bin" path component in my > $ENV{PATH}, and then

[Perl-unix-users] How to modify $ENV{PATH} portably?

2006-05-30 Thread Arijit Das
Hi, The format of env variable PATH seems to change with OS/shell. For example, in sh it is like "/dir1/bin:/dir2/bin:." while in csh, it is like (/dir1/bin /dir2/bin .) I need to search for "/dir2/bin" path component in my $ENV{PATH}, and then, insert "/newpath/bin" just before "/dir2/bin"