Re: script perl with sed command

2007-04-08 Thread Giorgos Keramidas
On 2007-04-07 17:31, Olivier Regnier [EMAIL PROTECTED] wrote: Hello, I have a problem with my perl script with the command sed. Here is a example of my code: Don't use system(sed ...) in Perl. It's considered poor style, since Perl can do the same without having to fork a shell/sed process.

Re: script perl with sed command

2007-04-08 Thread Garrett Cooper
Giorgos Keramidas wrote: On 2007-04-07 17:31, Olivier Regnier [EMAIL PROTECTED] wrote: Hello, I have a problem with my perl script with the command sed. Here is a example of my code: Don't use system(sed ...) in Perl. It's considered poor style, since Perl can do the same without having

Re: script perl with sed command

2007-04-08 Thread Josh Carroll
Interesting. Is that old perl syntax (v4, etc)? Just curious because most of the documentation and examples switched to: No, he's using a function prototype. In this particular case, he's saying the supfile_set_default_host function will take two scalars as arguments. For more info: perldoc

Re: script perl with sed command

2007-04-08 Thread Olivier Regnier
Giorgos Keramidas a écrit : On 2007-04-07 17:31, Olivier Regnier [EMAIL PROTECTED] wrote: Hello, I have a problem with my perl script with the command sed. Here is a example of my code: Don't use system(sed ...) in Perl. It's considered poor style, since Perl can do the same without

Re: script perl with sed command

2007-04-08 Thread Garrett Cooper
Olivier Regnier wrote: Giorgos Keramidas a écrit : On 2007-04-07 17:31, Olivier Regnier [EMAIL PROTECTED] wrote: Hello, I have a problem with my perl script with the command sed. Here is a example of my code: Don't use system(sed ...) in Perl. It's considered poor style, since

Re: script perl with sed command

2007-04-08 Thread Giorgos Keramidas
On 2007-04-08 11:40, Olivier Regnier [EMAIL PROTECTED] wrote: Giorgos Keramidas a ?crit : Try using Perl only, instead of forking sed(1), like this: ,--- | | #!/usr/bin/perl -Tw | | use strict; | | # | #

Re: script perl with sed command

2007-04-08 Thread Giorgos Keramidas
On 2007-04-08 09:28, Garrett Cooper [EMAIL PROTECTED] wrote: Olivier Regnier wrote: The file has to exist that you're trying to modify, otherwise it'll give up :). Permissions issue? Better to do that section may be: my $tmpsupfile; my $supfile = /etc/standard-supfile; my

Re: script perl with sed command

2007-04-08 Thread Giorgos Keramidas
On 2007-04-08 00:26, Garrett Cooper [EMAIL PROTECTED] wrote: Giorgos Keramidas wrote: Try using Perl only, instead of forking sed(1), like this: [...] | sub supfile_set_default_host($$); | sub supfile_set_default_host($$) | { [...] Interesting. Is that old perl syntax (v4, etc)? Just

Re: script perl with sed command

2007-04-07 Thread Warren Block
On Sat, 7 Apr 2007, Olivier Regnier wrote: I have a problem with my perl script with the command sed. Here is a example of my code: # Selecting the fast server print Using the server called $server; system(`/usr/bin/sed 's|\*default host=\(.*\)|\*default host=${server}|' $standard_supfile

Re: script perl with sed command

2007-04-07 Thread Olivier Regnier
Warren Block a écrit : On Sat, 7 Apr 2007, Olivier Regnier wrote: I have a problem with my perl script with the command sed. Here is a example of my code: # Selecting the fast server print Using the server called $server; system(`/usr/bin/sed 's|\*default host=\(.*\)|\*default

Re: script perl with sed command

2007-04-07 Thread Garrett Cooper
Olivier Regnier wrote: Hello, I have a problem with my perl script with the command sed. Here is a example of my code: # Selecting the fast server print Using the server called $server; system(`/usr/bin/sed 's|\*default host=\(.*\)|\*default host=${server}|' $standard_supfile