Re: escape quotes in GREP

2009-11-29 Thread lan messerschmidt
On Mon, Nov 30, 2009 at 3:46 PM, Uri Guttman wrote: > > what is [^()]* looking for? why couldn't () be inside the div tags? > Well, it's the OP's idea, not mime and YOURS. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://

Re: escape quotes in GREP

2009-11-29 Thread Uri Guttman
> "lm" == lan messerschmidt writes: lm> On Mon, Nov 30, 2009 at 12:40 PM, Julia Gallardo Lomeli lm> wrote: >> Hi, >> >> Lets say I want grep to find all > class="photo">whateverElementGoesInsideTheseDivTags in index.html >> >> I am using the code below but it seems that it's

Re: escape quotes in GREP

2009-11-29 Thread lan messerschmidt
On Mon, Nov 30, 2009 at 12:40 PM, Julia Gallardo Lomeli wrote: > Hi, > > Lets say I want grep to find all class="photo">whateverElementGoesInsideTheseDivTags in index.html > > I am using the code below but it seems that it's not working > > > grep -o "[^()]*"  index.html > Perl's grep can do: #

Re: escape quotes in GREP

2009-11-29 Thread Uri Guttman
> "JGL" == Julia Gallardo Lomeli writes: JGL> Lets say I want grep to find all class="photo">whateverElementGoesInsideTheseDivTags in index.html JGL> I am using the code below but it seems that it's not working JGL> grep -o "[^()]*" index.html and what is your perl question? grep i

escape quotes in GREP

2009-11-29 Thread Julia Gallardo Lomeli
Hi, Lets say I want grep to find all whateverElementGoesInsideTheseDivTags in index.html I am using the code below but it seems that it's not working grep -o "[^()]*" index.html (my guess is because I'm not properly escaping the quotes in "photo") What am I missing??? Thanks for the help

答复: reference to anonymous array, refe rences last element instead??

2009-11-29 Thread gaochong
perldoc perlref Making References References can be created in several ways. 1. By using the backslash operator on a variable, subroutine, or value. (This works much like the & (address-of) opera- tor in C.) This typically creates another reference to a variabl

Re: die unless match is successful

2009-11-29 Thread Dermot
2009/11/29 raphael() : > Hi, > > I want the below if loop to end if it cannot find any match & print the die > message. > However it just exit without hitting my "die" > > As you can see in the code below I have tried many foolish ways to make the > script say > that it cannot find the number searc

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Huub van Niekerk
On Sun, 29 Nov 2009 14:30:47 -0500, Shawn H Corey wrote: > Huub van Niekerk wrote: >> Hi, >> >> I started getting this error after upgrading from Fedora 11 to 12. The >> line of code hasn't been changed: >> >> open my $LPR, '|-', qw/lpr -PDeskJet940C/ or die "can't fork lpr: $!"; >> >> The erro

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Shawn H Corey
Huub van Niekerk wrote: > Hi, > > I started getting this error after upgrading from Fedora 11 to 12. The > line of code hasn't been changed: > > open my $LPR, '|-', qw/lpr -PDeskJet940C/ or die "can't fork lpr: $!"; > > The error is: "Insecure $ENV{PATH} while running with -T switch at" > poi

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Uri Guttman
> "O" == Owen writes: >>> there is no %PATH variable in perl. if you read the post about >>> clearing >>> the PATH in the ENVIRONMENT, you would just set that value in the >>> %ENV >>> hash. >>> >>> uri >> >> If you mean like this, it doesn't work. >> >> $ENV{"lpr"}

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Uri Guttman
> "HvN" == Huub van Niekerk writes: >> there is no %PATH variable in perl. if you read the post about clearing >> the PATH in the ENVIRONMENT, you would just set that value in the %ENV >> hash. >> >> uri HvN> If you mean like this, it doesn't work. HvN> $ENV{"lpr"} = "/usr/bi

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Owen
>> there is no %PATH variable in perl. if you read the post about >> clearing >> the PATH in the ENVIRONMENT, you would just set that value in the >> %ENV >> hash. >> >> uri > > If you mean like this, it doesn't work. > > $ENV{"lpr"} = "/usr/bin/lpr"; > > Nor do > > $ENV{"/usr/bin/lpr"} = "lpr"; >

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Huub van Niekerk
> there is no %PATH variable in perl. if you read the post about clearing > the PATH in the ENVIRONMENT, you would just set that value in the %ENV > hash. > > uri If you mean like this, it doesn't work. $ENV{"lpr"} = "/usr/bin/lpr"; Nor do $ENV{"/usr/bin/lpr"} = "lpr"; $ENV{"PATH"} = "/usr/bin

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Uri Guttman
> "HvN" == Huub van Niekerk writes: >> Try specifying the full path for lpr >> >> %whereis lpr >> lpr: /usr/bin/lpr.cups /usr/bin/lpr /usr/share/man/man1/lpr.1.gz >> >> So on my box, /usr/bin/lpr >> >> If you look at that article I sent you previously, it gives some >> ex

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Huub van Niekerk
> Try specifying the full path for lpr > > %whereis lpr > lpr: /usr/bin/lpr.cups /usr/bin/lpr /usr/share/man/man1/lpr.1.gz > > So on my box, /usr/bin/lpr > > If you look at that article I sent you previously, it gives some > explanation for why you need to reset $ENV{"PATH"} (from memory). > O

Re: die unless match is successful

2009-11-29 Thread raphael()
On Sun, Nov 29, 2009 at 3:58 PM, John W. Krahn wrote: > raphael() wrote: > >> Hi, >> > > Hello, > > > I want the below if loop to end if it cannot find any match & print the >> die >> message. >> However it just exit without hitting my "die" >> >> As you can see in the code below I have tried ma

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Dave Tang
On Sun, 29 Nov 2009 23:39:58 +1000, Huub van Niekerk wrote: open my $LPR, '|-', qw/lpr -PDeskJet940C/ or die "can't fork lpr: $!"; $ENV{"PATH"} = ""; at the start of the script, it doesn't seem to complain any more. Hope that helps, Thank you, though I'm not out of problems yet. The m

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Huub van Niekerk
>> >> open my $LPR, '|-', qw/lpr -PDeskJet940C/ or die "can't fork lpr: $!"; >> > > $ENV{"PATH"} = ""; > > at the start of the script, it doesn't seem to complain any more. > Hope that helps, > Thank you, though I'm not out of problems yet. The message I'm getting now is: Can't exec "lpr": No

Re: Insecure $ENV{PATH} message

2009-11-29 Thread Dave Tang
On Sun, 29 Nov 2009 16:30:56 +1000, Huub van Niekerk wrote: Hi, Hello, I started getting this error after upgrading from Fedora 11 to 12. The line of code hasn't been changed: open my $LPR, '|-', qw/lpr -PDeskJet940C/ or die "can't fork lpr: $!"; The error is: "Insecure $ENV{PATH} whil

Re: die unless match is successful

2009-11-29 Thread John W. Krahn
raphael() wrote: Hi, Hello, I want the below if loop to end if it cannot find any match & print the die message. However it just exit without hitting my "die" As you can see in the code below I have tried many foolish ways to make the script say that it cannot find the number searched in whi

Re: die unless match is successful

2009-11-29 Thread Erez Schatz
2009/11/29 raphael() : > Hi, > > I want the below if loop to end if it cannot find any match & print the die > message. > However it just exit without hitting my "die" > Any Ideas? > Lots. First, give us some more information regarding which data you're comparing to what. In the code example you

die unless match is successful

2009-11-29 Thread raphael()
Hi, I want the below if loop to end if it cannot find any match & print the die message. However it just exit without hitting my "die" As you can see in the code below I have tried many foolish ways to make the script say that it cannot find the number searched in while loop. while ( my $lin