[PLUG] Trouble with CGU forms...

Grish grishnav at egosurf.net
Mon Nov 24 00:29:02 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Michael C. Robinson wrote:

|
| Well, if I can find the right way to execute a non perl command
| like sed in the client perl CGI script, I should be able to  break
|  the long line and assign the pieces off.


Why in the HELL would you want to execute SED from a perl script?

You can execute with backticks, or system(), and open().
`sed -e "blah"`;
system("sed -e \"blah\"");
open(SED,"sed -e \"blah\" |");

But why? Anything sed can do, perl can do better.

Consider the following:

cat randfile | sed -e 's/field/b/'

perl:

cat randfile | perl -ne 's/field/b/; print;'

They will produce the exact same output.

| I think there are some bugs in my script overall.


If you're executing sed from a perl script, yeah, there probably are.

| I thought all variables were global in perl.


No... though I can't remember exactly what the rules are anymore...

| Maybe my subroutines need to be defined within the main function to
| give all the variables global scope.


??

Why do all of your variables /need/ global scope?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQE/wcEJVo//RA50KO0RAhLXAJoCrFUyA0kcB8usXaG43V5rMYzg+QCggusR
9DU824V9bwtLfBeX5KmoVZY=
=VQxM
-----END PGP SIGNATURE-----







More information about the PLUG mailing list