Re: multistring replacement

2006-03-08 Thread Bob Showalter
Chas Owens wrote: On 3/8/06, Eugeny Altshuler <[EMAIL PROTECTED]> wrote: snip local $/; # to slurp the file at once my $joined=<>; ... Be careful with the setting of $/. In small scripts like this one it is not very dangerous, but in larger scripts in can cause all manner of bugs if not prope

Re: multistring replacement

2006-03-08 Thread Chas Owens
On 3/8/06, Eugeny Altshuler <[EMAIL PROTECTED]> wrote: snip > local $/; # to slurp the file at once > my $joined=<>; snip > What '\s*=\s*(["']).*?\1' mean? Be careful with the setting of $/. In small scripts like this one it is not very dangerous, but in larger scripts in can cause all manner of

Re: multistring replacement

2006-03-08 Thread Eugeny Altshuler
> That's one way to pass the file content to a script via the STDIN filehandle. > A shorter way is to pass the filename to the script: > > $ ./myscript file.html > > Try out this code: > > #!/usr/bin/perl > use strict; > use warnings; > > open my $fh, $ARGV[0] or die "can't open passed file '$ARGV[

Re: multistring replacement

2006-03-08 Thread Hans Meier (John Doe)
Eugeny Altshuler am Mittwoch, 8. März 2006 11.35: > Hello! > > I have such problem, I need to make multistring replacement... How can > I do this? > > I tried to make perl script which acquires file form STDIN and prints > result into STDOUT > > cat file.html | ./myscript That's one way to pass th