[19073] in Perl-Users-Digest
Perl-Users Digest, Issue: 1268 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 9 03:05:26 2001
Date: Mon, 9 Jul 2001 00:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <994662308-v10-i1268@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 9 Jul 2001 Volume: 10 Number: 1268
Today's topics:
Re: (csv) Split at a coma, how? <skilchen@swissonline.ch>
[thanks] grouping characters in variables in Regexps... <NOSPAMricharddmorey@yahoo.com>
Assigning RegEx to variables (Dly)
Re: Assigning RegEx to variables (Sam Holden)
Re: Assigning RegEx to variables (Tim Hammerquist)
Re: Assigning RegEx to variables <krahnj@acm.org>
Re: automatic form submission <creafin1998@yahoo.com>
Re: automatic form submission (Smiley)
Call Perl from VB <keng@spinalfluid.com>
Re: Call Perl from VB (Tim Hammerquist)
Re: Call Perl from VB <pne-news-20010709@newton.digitalspace.net>
Re: calling a PERL script from Matlab <pmenter@bignet.net>
FAQ: What is a JAPH? <faq@denver.pm.org>
Re: I am at a loss as to which database solution to use <newspost@coppit.org>
Re: Perl and PHP <chok@ece.gatech.edu>
Perl vs. PHP for CGI in the long-run <pr_NOSPAM_lx@m*NOSPAM*ac.com>
Re: Posting HTML table from a file? (Ted)
program control <creafin1998@yahoo.com>
Re: program control <dbe@wgn.net>
referencing methods <thomasalbrightREMOVE@home.com>
Re: referencing methods (Eric Bohlman)
Re: Simple Reg Ex - Why not greedy? (mc)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 9 Jul 2001 04:44:58 +0200
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: (csv) Split at a coma, how?
Message-Id: <9ib653$hsj8d$1@ID-13368.news.dfncis.de>
"Benjamin Goldberg" <goldbb2@earthlink.net> schrieb im Newsbeitrag
news:3B48AF0A.8669CD20@earthlink.net...
[...]
> while(<$fh>) {
here you read the next line before you know if $_ already contains a
parseable record:
> $_ .= <$fh> until( $csv->parse $_ or eof $fh );
> if( !$csv->status ) {
> die "Unexpected EOF at line $.\n" if eof $fh;
you will never get here, because $csv->parse() only returns a true value if
it successfully parsed the input.
> my $err = $csv->error_input;
> die "Invalid CSV data: <$err> at line $.\n";
> }
> print &Tr td [ map{ encode_entities $_ }, $csv->fields ];
^
what is this good for?
> }
I don't think that this loop will work as expected. (Unless the original
problem specification included a sentence like: "2 or more lines in the
input file form one record".)
If you have to deal with multiline fields in the input (and you don't want
to use the getline method from Text::CSV_XS), then the looping logic has to
go along these lines:
my $buffer = '';
my $success = 0;
while (defined(my $line = <$fh>)) {
$buffer .= $line;
$success = $csv->parse($buffer);
if ($success) {
my @fields = $csv->fields();
if (@fields > 0) {
print &Tr td [ map { encode_entities($_) } @fields ];
}
$buffer = '';
}
}
unless ($success) {
my $eff = $csv->error_input();
die "Invalid CSV data: <$err> at line $.\n";
}
------------------------------
Date: Sun, 8 Jul 2001 22:30:56 -0400
From: "Richard Morey" <NOSPAMricharddmorey@yahoo.com>
Subject: [thanks] grouping characters in variables in Regexps...
Message-Id: <9ib4u3$orr$1@news.fsu.edu>
Thanks for the help.
Richard Morey
--
***********************************
"The advancement and diffusion of knowledge is the only guardian of true
liberty." -James Madison
***********************************
"Richard Morey" <NOSPAMricharddmorey@yahoo.com> wrote in message
news:9i8smd$4gt$1@news.fsu.edu...
>
> Here are two similar chunks of code:
>
> #This, with braces....
> $test = "My name is {print this}";
> $openp = "{";
> $closep = "}";
>
> $test=~/$openp(.*?)$closep/i;
> print "$test\n";
> print $1;
>
> #This, with parentheses....
> $test = "My name is (print this)";
> $openp = "(";
> $closep = ")";
>
> $test=~/$openp(.*?)$closep/i;
> print "$test\n";
> print $1;
>
> The first works as expected - it prints:
>
> My name is {print this}
> print this
>
> The second, however, doesn't. It outputs:
>
> My name is {print this}
>
>
> What is wrong? Why can't I use the parentheses?
> Thanks in advance for your help, or a direction to the part of the FAQ
where
> I can find it.
>
> Richard Morey
>
> ***********************************
> "The advancement and diffusion of knowledge is the only guardian of true
> liberty." -James Madison
> ***********************************
>
>
------------------------------
Date: 8 Jul 2001 21:52:34 -0700
From: elylyd@hotmail.com (Dly)
Subject: Assigning RegEx to variables
Message-Id: <8c3b72dc.0107082052.778ca377@posting.google.com>
Hi,
I'm getting syntax errors when i try to assign a regular expression to
a variable. This is what i've done:
my $filetypes = "\.(htm|asp|html)$";
$url =~ /\Q$filetypes\E/
This is the error message i get:
Final $ should be \$ or $name at C:\x.pl line 57, within string
syntax error at C:\x.pl line 57, near "= "\.(htm|asp|html)$""
syntax error at C:\x.pl line 75, near ") {"
could someone please help?
regards,
Dave
------------------------------
Date: 9 Jul 2001 05:28:22 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Assigning RegEx to variables
Message-Id: <slrn9kig7r.b0t.sholden@pgrad.cs.usyd.edu.au>
On 8 Jul 2001 21:52:34 -0700, Dly <elylyd@hotmail.com> wrote:
>Hi,
>
>I'm getting syntax errors when i try to assign a regular expression to
>a variable. This is what i've done:
>
> my $filetypes = "\.(htm|asp|html)$";
>
> $url =~ /\Q$filetypes\E/
>
>
>This is the error message i get:
>
>Final $ should be \$ or $name at C:\x.pl line 57, within string
>syntax error at C:\x.pl line 57, near "= "\.(htm|asp|html)$""
>syntax error at C:\x.pl line 75, near ") {"
>
>
>could someone please help?
The error message tells you exactly what the error is. Why don't you do
what it says...
Hint : 'Final $ should be \$'.
You don't want the \Q and \E... Unless you want to match the literal string
in your variable...
\. doesn't mean what you think it means in a string...
Try \\.
You really should read the perlop documentation (perldoc perlop), it documents
quoting. Read the section headed : "Gory details of parsing quoted constructs".
Then go back a few pages and read about qr//. And change your code to use
it instead of fighting against perl's quoting behaviour...
--
Sam Holden
------------------------------
Date: Mon, 09 Jul 2001 05:29:14 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Assigning RegEx to variables
Message-Id: <slrn9kigvv.28v.tim@vegeta.ath.cx>
Dly <elylyd@hotmail.com> wrote:
> I'm getting syntax errors when i try to assign a regular expression to
> a variable. This is what i've done:
>
> my $filetypes = "\.(htm|asp|html)$";
>
> $url =~ /\Q$filetypes\E/
>
>
> This is the error message i get:
>
> Final $ should be \$ or $name at C:\x.pl line 57, within string
> syntax error at C:\x.pl line 57, near "= "\.(htm|asp|html)$""
> syntax error at C:\x.pl line 75, near ") {"
Try any of these. Should work:
"\.(htm|asp|html)\$"
'\.(htm|asp|html)$'
qr/\.(htm|asp|html)$/;
If you use a bare '$' in a "" (double-quoted) string, perl thinks you
want to interpolate a variable. Escape the '$', use '' (single-quotes)
which don't interpolate, or use the qr// (quote regex) syntax.
HTH
--
-Tim Hammerquist <timmy@cpan.org>
I don't think Ted is a
fascist of the marrying kind.
-- Fred, 'Barcelona'
------------------------------
Date: Mon, 09 Jul 2001 05:50:06 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Assigning RegEx to variables
Message-Id: <3B494653.94BCA3EF@acm.org>
Dly wrote:
>
> Hi,
>
> I'm getting syntax errors when i try to assign a regular expression to
> a variable. This is what i've done:
>
> my $filetypes = "\.(htm|asp|html)$";
The double quotes cause perl to interpolate the string. perl thinks the
$" at the end is the list separator variable. perl interpolates the "\."
to '.' which in a regex will match any character.
> $url =~ /\Q$filetypes\E/
If you remove the errors from the previous line you are going to run
into problems here with the quotemeta escape character (\Q) as (, |, )
and $ will be escaped which is not what you want.
> This is the error message i get:
>
> Final $ should be \$ or $name at C:\x.pl line 57, within string
> syntax error at C:\x.pl line 57, near "= "\.(htm|asp|html)$""
> syntax error at C:\x.pl line 75, near ") {"
>
> could someone please help?
Try it this way instead:
my $filetypes = qr/\.(htm|asp|html)$/;
$url =~ /$filetypes/
# OR
my $filetypes = '\.(htm|asp|html)$';
$url =~ /$filetypes/
John
--
use Perl;
program
fulfillment
------------------------------
Date: Sun, 8 Jul 2001 20:50:06 -0500
From: "John Smith" <creafin1998@yahoo.com>
Subject: Re: automatic form submission
Message-Id: <tki30vls8cj945@corp.supernews.com>
Got it working.
"John Smith" <creafin1998@yahoo.com> wrote in message
news:tkh5q5jm1dd33b@corp.supernews.com...
> I don't think that will work, but I'll try anything.
>
> I cannot use a <body onload...>
>
> I think I just need to understand the myForm.submit();
> What is wrong (if anything) with the following? My problem could be with
> the perl scripts I'm passing the values to as params. I'm looking at it
> now. The automatic submit seems to execute as I've seen from my cgi error
> log that the script.pl is executing when errors occur inside script.pl.
> I'll cross-post this message to the main javascript group in hopes for
help
> there too.
>
> <FORM NAME ="myForm" METHOD="POST" ACTION="script.pl">
> <input type="hidden" name="config" value="cfgvarval">
> <input type="hidden" name="myvar" value="myvarval">
> </FORM>
>
> <SCRIPT LANGUAGE="JavaScript1.1">
> <!-- Begin
> myForm.submit();
> // End -->
> </script>
>
> Thank you. Anyone, please provide further help here.
>
>
> "Smiley" <gurm@intrasof.com> wrote in message
> news:3b47fd6f.16654147@news1.on.sympatico.ca...
> > John,
> >
> > I'm not sure I understand what you're getting at here - but if you
> > want to send form data to a script without actually getting the data
> > from the user, it's pretty easy to do. You'd just refer to the script
> > something like this :
> >
> >
>
http://www.yourserver.com/cgi-bin/yourscript.cgi?item1="Hello"&item2="There"
> >
> > Your form data are item1 and item2, and their values respectively are
> > Hello and There. Doing this you don't have to submit the data from a
> > form when you call the script.
> >
> > Is that what you wanted to know? If not, could you be a little more
> > specific?
> >
> > On Sat, 7 Jul 2001 22:05:35 -0500, "John Smith"
> > <creafin1998@yahoo.com> wrote:
> >
> > >Does anyone know how to submit a form automatically (cannot require
> buttons
> > >or user interaction) within a perl script? I've tried the following
with
> a
> > >few variations:
> > >
> > >print "
> > ><FORM NAME =\"Somescript\" METHOD=\"POST\" ACTION=\"script.pl\"> <input
> > >type=\"hidden\" name=\"config\" value=\"$configvar\"> <input
> > >type=\"hidden\" name=\"myvar\" value=\"$myvar\"
> > >onChange=\"Somescript.submit()\"> </FORM>";
> > >
> > >Please help.
> > >
> > >Thanks in advance.
> >
>
>
------------------------------
Date: Mon, 09 Jul 2001 06:51:20 GMT
From: gurm@intrasof.com (Smiley)
Subject: Re: automatic form submission
Message-Id: <3b49543f.104414299@news1.on.sympatico.ca>
Glad to hear it. Did my advice help or did you figure something else
out?
>Got it working.
>
>
>"John Smith" <creafin1998@yahoo.com> wrote in message
>news:tkh5q5jm1dd33b@corp.supernews.com...
>> I don't think that will work, but I'll try anything.
>>
>> I cannot use a <body onload...>
>>
>> I think I just need to understand the myForm.submit();
>> What is wrong (if anything) with the following? My problem could be with
>> the perl scripts I'm passing the values to as params. I'm looking at it
>> now. The automatic submit seems to execute as I've seen from my cgi error
>> log that the script.pl is executing when errors occur inside script.pl.
>> I'll cross-post this message to the main javascript group in hopes for
>help
>> there too.
>>
>> <FORM NAME ="myForm" METHOD="POST" ACTION="script.pl">
>> <input type="hidden" name="config" value="cfgvarval">
>> <input type="hidden" name="myvar" value="myvarval">
>> </FORM>
>>
>> <SCRIPT LANGUAGE="JavaScript1.1">
>> <!-- Begin
>> myForm.submit();
>> // End -->
>> </script>
>>
>> Thank you. Anyone, please provide further help here.
>>
------------------------------
Date: Mon, 9 Jul 2001 12:28:15 +0800
From: "keng" <keng@spinalfluid.com>
Subject: Call Perl from VB
Message-Id: <9ibbsb$jr$1@violet.singnet.com.sg>
hi
anyone know if i can call perl prog from VB?
if it is possible, can you direct me to where i can find more info on it?
i tried support.microsoft.com but to no avail
thanks
--
regards
isaac
------------------------------
Date: Mon, 09 Jul 2001 05:26:20 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Call Perl from VB
Message-Id: <slrn9kigqg.28v.tim@vegeta.ath.cx>
keng <keng@spinalfluid.com> wrote:
> hi
> anyone know if i can call perl prog from VB?
> if it is possible, can you direct me to where i can find more info on it?
> i tried support.microsoft.com but to no avail
Not surprised, what with Microsoft declaring Perl and several other Open
Source softwares "potentially viral." [1]
If you mean calling PerlScript from VBScript in client-side script, yes,
it's possible.
If you mean calling a Perl script from a VB app, I'm not sure. You
probably want to ask a VB person what you can do in this case.
[1] http://dailynews.yahoo.com/h/zd/20010702/tc/ms_attacks_open_source_1.html
HTH
--
-Tim Hammerquist <timmy@cpan.org>
She brought in herself and we all pay the penalty...
She took on the world and lost everything on the way;
Poor girl, they'll say."
-- "All About Paula", Limp
------------------------------
Date: Mon, 09 Jul 2001 08:24:25 +0200
From: Philip Newton <pne-news-20010709@newton.digitalspace.net>
Subject: Re: Call Perl from VB
Message-Id: <fdjikt4tm086vga4ooq6aibqk6mq6i4607@4ax.com>
On Mon, 09 Jul 2001 05:26:20 GMT, tim@vegeta.ath.cx (Tim Hammerquist)
wrote:
> keng <keng@spinalfluid.com> wrote:
> > anyone know if i can call perl prog from VB?
>
> If you mean calling a Perl script from a VB app, I'm not sure. You
> probably want to ask a VB person what you can do in this case.
You can probably get somewhere by using PerlCtrl or PerlCOM (or
something like that) to turn your Perl script into an ActiveX control or
a COM object that you can manipulate from VB. They're payware from
ActiveState.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Mon, 09 Jul 2001 01:18:57 -0400
From: Patrick Menter <pmenter@bignet.net>
Subject: Re: calling a PERL script from Matlab
Message-Id: <3B493EC1.2BE01362@bignet.net>
Hi Steve,
Just use the callperl command in matlab 6.0.
Patrick
Steve Miller wrote:
> Hi!
>
> This SEEMS like something one should be able to do....
>
> Background: I need to get Windows (NT and 98) to split a file for
> further processing by Matlab. On Unix, I just shell out and call
> split.
>
> I have a perl script that emulates the Unix command of the same name.
> I'd
> like to shell out from Matlab (in Windows) and split the file, but I
> don't
> know the first thing about PERL. The first part of the script follows
> my signature. (I can send the whole thing if reequested.) What happens
> is:
>
> » !perl split.pl -4800000 hnk.bin hnk
> Can't locate strict.pm in @INC at split.pl line 12.
> BEGIN failed--compilation aborted at split.pl line 12.
>
> AFAIK, I have only the PERL that is included with Matlab on my
> machine.
> Am I calling this correctly? Are there other things I need to
> download?
> Is there a better way to do this that I don't know about?
>
> Thanks!
>
> Steve
>
> ***
>
> #!/usr/bin/env perl
> #
> # split -- split a file into pieces
> #
> # Rich Lafferty <rich@alcor.concordia.ca>
> # Sat Mar 6 22:27:28 EST 1999
> #
> # Perl Power Tools -- http://language.perl.com/ppt/
> #
>
> $^W = 1; # -w
> use strict;
> use Getopt::Std;
> use File::Basename;
>
> my $me = basename($0);
--
Ta Ta For Now,
Patrick
------------------------------
Date: Mon, 09 Jul 2001 06:17:00 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: What is a JAPH?
Message-Id: <w%b27.75$T3.170761728@news.frii.net>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.
+
What is a JAPH?
These are the "just another perl hacker" signatures that some people
sign their postings with. Randal Schwartz made these famous. About 100
of the earlier ones are available from
http://www.perl.com/CPAN/misc/japh .
-
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to
news:news.answers
or to the many thousands of other useful Usenet news groups.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan
Torkington. All rights reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
01.13
--
This space intentionally left blank
------------------------------
Date: Mon, 09 Jul 2001 00:56:28 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: I am at a loss as to which database solution to use....
Message-Id: <3B49397C.9090002@coppit.org>
Carlos C. Gonzalez wrote:
> I am at a loss as to which database solution to use for my site. I
> have spent hour upon hour looking through a bunch of material on
> different database solutions and just don't know which way to go. Any
> help would be very appreciated. I have scoured the Internet and there
> is very little if anything comparing the relative merits or demerits
> of database solutions.
[snip]
> My web site is being hosted on a Unix server.
>
> The only other constraint is that I need a database solution that can
> be accessed through ActiveState's Windows Perl. So that I can develop
> code for it on Windows Apache and then transfer the code easily to my
> Unix web hoster.
You should consider using a "real" DB if there's any chance that you may
want to do more aggressive processing of the data later. You'll save
yourself some effort in porting your data. For example, see if your Unix
host already has DB support -- MySQL is common. Then you can write your
code to talk to the DB over the Internet. (So the same code works from
both Windows or Unix.)
David
------------------------------
Date: Sun, 08 Jul 2001 22:22:29 -0400
From: ChokSheak Lau <chok@ece.gatech.edu>
Subject: Re: Perl and PHP
Message-Id: <3B491565.3F82AEA2@ece.gatech.edu>
perl CGI is pretty slow actually, but I've found Java servlets to run faster
than PHP.
i might be wrong though, never timed it for sure.
chok
None wrote:
> Since PHP evolved from Perl, what are the major differences between
> the languages? From my examination they look very similar and
> I have had success changing minor things in php scripts to work
> under Perl. Other than that the syntax looks exactly the same.
>
> What is so good about PHP (different from perl) that makes it so popular?
------------------------------
Date: Mon, 09 Jul 2001 03:01:25 GMT
From: "R. Eranki" <pr_NOSPAM_lx@m*NOSPAM*ac.com>
Subject: Perl vs. PHP for CGI in the long-run
Message-Id: <080720012302338380%pr_NOSPAM_lx@m*NOSPAM*ac.com>
'lo all.
What do you guys think of the future of Perl as a CGI language? I've
used Perl for a while, and have been (unfortunately) using PHP more
recently, simply because it's fast (although mod_perl should be only
slightly slower, correct?).
Now, I'm writing some free forums for the hell of it, and I've started
in PHP, but I'm getting terribly frustrated when I'd like to do
something similar to Perl (At least C global scope, for cryin' out
loud!). How can I convince myself to use Perl?
How long will Perl stay as a common CGI language?
Is there any effort being made to increase Perl's performance in
general, and with databases?
Heh. Sounds like a new drug. "I do PHP because all my friends do it!"
------------------------------
Date: 8 Jul 2001 22:03:02 -0700
From: ted9669@yahoo.com (Ted)
Subject: Re: Posting HTML table from a file?
Message-Id: <c9cff006.0107082103.40bf0046@posting.google.com>
Thanks to those who helped me with this problem -- I plan to implement
several of the tips I picked up here. I did come up with a quick
work-around for the time-being, but the first line of output is always
"HASH(0x80d6c74)" which i assume is the address of whatever hash
begins the table. Please have a gander at my code:
#!/usr/bin/perl -w
use strict;
use CGI qw/:standard/;
open (INFILE, "/tmp/out.test");
my @headings = ('Name', 'M Name', 'Dept No', 'Emp No', 'MS', 'Dept
Name', 'Shift', 'Date Requested', 'Domains');
my @rows = th(\@headings);
my @line;
while (<INFILE>) {
chomp;
@line = split (/\|/, <INFILE>);
push (@rows, td({-width=>'6%', -align=>'center',
-height=>'45'},[@line[0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12]]));
}
close(INFILE);
print header(),
start_html(-xbase=>'http://mypage/test',
-head=>meta({-http_equiv=>'Refresh', -content=>'600'})),
font({-face => 'arial', -size=>2},
table({-width=>'100%', -height=>'100', -border=>'0',
-cellpadding=>'0', -cellspacing=>'1'},
Tr(\@rows),
)),
end_html();
I'm sorry if the spacing of the code is completely off, I tried this
with Google.
Thanks for any and all help,
.ted
------------------------------
Date: Sun, 8 Jul 2001 20:47:46 -0500
From: "John Smith" <creafin1998@yahoo.com>
Subject: program control
Message-Id: <tki2sms106os06@corp.supernews.com>
I have an html form within a perl script that I have automatically
submitting via javascript to another perl script. This works fine.
The problem is that I need the 2nd perl script to return control to where
the first perl script left off. Is this possible? I can get snippits if
deemed possible.
Thanks in advance.
------------------------------
Date: Sun, 08 Jul 2001 20:11:44 -0700
From: "$Bill Luebkert" <dbe@wgn.net>
Subject: Re: program control
Message-Id: <3B4920F0.2C24501E@wgn.net>
John Smith wrote:
>
> I have an html form within a perl script that I have automatically
> submitting via javascript to another perl script. This works fine.
>
> The problem is that I need the 2nd perl script to return control to where
> the first perl script left off. Is this possible? I can get snippits if
> deemed possible.
If I understand correctly, just pass an arg to tell the script to go to
part 2 and then in the script do something like:
if part == 1
do this
else if part == 2
do that
endif
/cgi-bin/script.pl?part=2
or something similar will tell the script it's on part2.
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles Mailto:dbe@todbe.com
/ ) /--< o // // http://dbecoll.webjump.com/ (Free Perl site)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
------------------------------
Date: Mon, 09 Jul 2001 01:12:02 GMT
From: Skycrawler <thomasalbrightREMOVE@home.com>
Subject: referencing methods
Message-Id: <3B4904EE.5020102@home.com>
I know that to reference a subroutine use:
$code_ref = \&sub
But how do I reference a method in a class such as:
$class->sub()
Thanks in advance for any help.
------------------------------
Date: 9 Jul 2001 01:33:02 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: referencing methods
Message-Id: <9ib1ke$qvk$1@bob.news.rcn.net>
Skycrawler <thomasalbrightREMOVE@home.com> wrote:
> I know that to reference a subroutine use:
> $code_ref = \&sub
> But how do I reference a method in a class such as:
> $class->sub()
$code_ref = $class->can('sub');
See "Default UNIVERSAL methods" in perlobj for more info.
------------------------------
Date: Mon, 09 Jul 2001 04:09:04 GMT
From: nospam@home.com (mc)
Subject: Re: Simple Reg Ex - Why not greedy?
Message-Id: <3b492d79.86501612@news>
On Mon, 09 Jul 2001 00:34:35 GMT, Bart Lateur <bart.lateur@skynet.be>
wrote:
>mc wrote:
>
>>I thought about that too but {1,2} can match one or two times,
>>yet it matches two. Why does {0,2} appear to follow a different rule?
>
>You know, there's both greed and laziness in a regex. The regex will
>attempt to do an as greedy as possibly match at the current starting
>point. Only if it fails, it will do a next attempt on the next character
>position, i.e. right after the first character.
>
>So /(diddle.){1,2}/ has to match at least one diddle something. Anything
>less is a failure. So the regex will continue attempting matching
>"diddle" something, until it succeeds. At that point there are two
>diddles, so that is what it matches. Greediness: an as long as possible
>match at the first position where it matches.
>
>But /(diddle.){0,2}/ only needs to match... nothing. That match will
>succeed on every starting point, including at the very start of the
>string. So that's where it matches. No "diddle"s there, but that's good
>enough. And there no reason to go on searching for a longer match. That
>NEVER happens. So
>
> "abbabbba" =~ /b+/
>
>will only match two b's, because that's how many there are at the first
>position that the regex matches. The fact that there could have been a
>longer match further on, is never even considered.
>
>In fact, trying to find the longest match in a string, is not a trivial
>question. It's a good exercise, even for experienced perlers.
Thanks. I understand now, as long as I don't think about it too hard.
:)
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1268
***************************************