|
Prev: FAQ 4.75 How do I verify a credit card checksum?
Next: Why isn't variable maintained between subroutines in .pm module?
From: Ed Jay on 18 Feb 2007 12:34 I apologize in advance for asking what probably has a simple answer that I can't seem to find. Can I pass parameters from one Perl script to another Perl script without using cookies? Is there a method similar to using hidden form elements to submit parameters from an HTML page to a Perl script? -- Ed Jay (remove 'M' to respond by email)
From: J�rgen Exner on 18 Feb 2007 12:46 Ed Jay wrote: > I apologize in advance for asking what probably has a simple answer > that I can't seem to find. > > Can I pass parameters from one Perl script to another Perl script Trivial. When script A calls script B just pass the parameters along just as you would do when calling any other program. And script B will find the parameter in @_, just as if called from the command line. If you want to pass more complex data than simple parameters Perl also supports pretty much any commonly used IPC method. jue
From: Ed Jay on 18 Feb 2007 13:08 J�rgen Exner scribed: >Ed Jay wrote: >> I apologize in advance for asking what probably has a simple answer >> that I can't seem to find. >> >> Can I pass parameters from one Perl script to another Perl script > >Trivial. When script A calls script B just pass the parameters along just as >you would do when calling any other program. I knew it had to be trivial, but to a Perl newbie, nothing is really trivial. :-) >And script B will find the >parameter in @_, just as if called from the command line. >If you want to pass more complex data than simple parameters Perl also >supports pretty much any commonly used IPC method. > I understand there are several IPC methods available. Again, as a newbie trying to solve some script problems without a comprehensive Perl understanding, I simply am at a loss at how to do it. I'm trying to use the redirect function to port one scripts parameters to another script that generates a dynamic HTML page. I don't want to use cookies or files. I'm currently snowed at how to do it. Thanks for your input. -- Ed Jay (remove 'M' to respond by email)
From: Michele Dondi on 18 Feb 2007 13:10 On Sun, 18 Feb 2007 09:34:40 -0800, Ed Jay <edMbj(a)aes-intl.com> wrote: >Can I pass parameters from one Perl script to another Perl script without >using cookies? Is there a method similar to using hidden form elements to Yes: #!/usr/bin/perl use strict; use warnings; system 'perl', 'otherscript.pl', @ARGV; __END__ Michele -- {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB=' ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_, 256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
From: Ed Jay on 18 Feb 2007 13:15
Michele Dondi scribed: >On Sun, 18 Feb 2007 09:34:40 -0800, Ed Jay <edMbj(a)aes-intl.com> wrote: > >>Can I pass parameters from one Perl script to another Perl script without >>using cookies? Is there a method similar to using hidden form elements to > >Yes: > > #!/usr/bin/perl > > use strict; > use warnings; > > system 'perl', 'otherscript.pl', @ARGV; > Thank you! -- Ed Jay (remove 'M' to respond by email) |