Paul D. Kraus wrote at Thu, 17 Jul 2003 15:33:11 -0400:
> Is there a way to assign a single value to a list? other then doing the
> obvious and spelling out each list assignment or running through a loop.
>
> For instance...
>
> my ( $var1, $var2, $var3, ... ) = "Paul"
> assigning paul to all va
Jamie Risk wrote at Thu, 17 Jul 2003 10:39:56 -0400:
> Until now, I've avoided writing modules by inlining the deisred code in the
> new files. Messy. I'm avoiding modules for two reasons, laziness and naive
> conception that for what I'm trying to do it's overkill.
>
> Is there a method to refe
Trensett wrote at Wed, 16 Jul 2003 18:29:51 -0500:
>> The next will work:
>> my @variable = $string =~ /\((.*?)\)/g;
>
> what's the exact implication of ".*?"?
> Why wouldn't just .* in parenthesis work for this case?
A good answer can also be found in
perldoc perlre
and
perldoc -q greedy
Gree
Janek Schleicher wrote:
> Paul D. Kraus wrote at Thu, 17 Jul 2003 15:33:11 -0400:
>
> > Is there a way to assign a single value to a list? other then
> > doing the obvious and spelling out each list assignment or
> > running through a loop.
> >
> > For instance...
> >
> > my ( $var1, $var2, $var3,
Hello.
CGI.pm module can restrict the size of the file being uploaded.
You canb use something like this:
my $max_size = 512000; #For 500kb limit
$CGI::POST_MAX=$max_size;
If the file size is bigger than that, it stop the process and returns an
error message.
But, thinking about it now, it's b
Hello.
CGI.pm module can restrict the size of the file being uploaded.
You canb use something like this:
my $max_size = 512000; #For 500kb limit
$CGI::POST_MAX=$max_size;
If the file size is bigger than that, it stop the process and returns an
error message.
But, thinking about it now, it's b
Hi,
could someone give me a quick info whar __END__ and __DATA__ lines are
good for?
Gabaux
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Gabor Urban wrote:
> Hi,
>
>
> could someone give me a quick info whar __END__ and __DATA__ lines
> are good for?
>
Short silly answer:
__END__ing the program and starting the __DATA__ that you can
read from the implicit filehandle.
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
my (%LIST, @other_list);
@other_list = ( Unknown Length Data Elems );
foreach my $col (@lists)
{
for (@other_list)
{
if ( exist $LIST{$col}[0] ) { Do_smth_2 } # But ERROR either
What should I write here ? So can push vars to $LIST{$col}
}
}
Thanks in advi
Ramprasad wrote:
else
Instead in your main program call
do "foo.pl args..."
And in foo.pl set some scope defined variable like
#foo.pl
$dbh=connect()
unless($dbh){
$GLOBAL::ERRORSTR="Couldnot connect to database $@";
exit 1
}
And in the main program you can check
if($GLOBAL::ERRORSTR) {
> Anyone know if it's possible for the return/exit value of a script, in the
> event of success, to be something other than 0?
>
The 'exit' command should work just like it does in the shell: 'exit 9;' for
example, *should* give you an exit status of 9 (although I couldn't get it
to work for me a m
Here's a quick way:
perl -e '$var="abdaatela"; print ((scalar grep /a/,(split /(.)/,$var)),"\n");'
grep returns the number of matches in a scalar context, and the split breaks
the string up into separate elements. The parens in the split return the
item split on (otherwise it would throw away each
On Fri, Jul 18, 2003 at 01:15:15PM -0500, Paul Archer wrote:
> Here's a quick way:
> perl -e '$var="abdaatela"; print ((scalar grep /a/,(split /(.)/,$var)),"\n");'
>
> grep returns the number of matches in a scalar context, and the split breaks
> the string up into separate elements. The parens in
What are you trying to do? If you could include a brief example, it
would be nice.
Li Ngok Lam wrote:
> my (%LIST, @other_list);
>
> @other_list = ( Unknown Length Data Elems );
>
> foreach my $col (@lists)
> {
> for (@other_list)
> {
> if ( exist $LIST{$col}[0] ) { Do_smth_2 }
On 17.07.03,14:51, Keith Olmstead wrote:
> Hello,
>
> Been searching though this list for awhile now, and now I am needing some help. I
> am not asking for someone to do my code for me, I am trying to learn perl and the
> only way for me to do that is to dive staight into it.
>
> My problem i
Anyone have any ideas about this - is there a common mistake I might be
making here?
I am using a simple regex to extract a few pieces of every line of a 2000+
line text file then spitting it back into a second text file. I can't figure
out why but the output file always includes every other li
Andrew Thomas wrote:
> Anyone have any ideas about this - is there a common mistake I
> might be making here?
>
> I am using a simple regex to extract a few pieces of every line of
> a 2000+ line text file then spitting it back into a second text
> file. I can't figure out why but the output file a
> Anyone have any ideas about this - is there a common mistake I might be
> making here?
>
> I am using a simple regex to extract a few pieces of every line of a 2000+
> line text file then spitting it back into a second text file. I can't
figure
> out why but the output file always includes every
Li Ngok Lam wrote:
>
> my (%LIST, @other_list);
>
> @other_list = ( Unknown Length Data Elems );
>
> foreach my $col (@lists)
> {
> for (@other_list)
> {
> if ( exist $LIST{$col}[0] ) { Do_smth_2 } # But ERROR either
If you want to test if the array has any elements you can do
Jamie Risk wrote:
I've no control over the EOL of text files that I'm processing; is there a
conveniant method using chomp() and the INPUT_RECORD_SEPERATOR ($/) to
handle DOS/UNIX/MAC generated text files automatically?
Handle them how?
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTEC
Hi all,
I have downloaded and installed perl with apache and php
Here are the readme file folders for each part of the packaged file
Perl-5.8-win32-bin-0.1.exe
openssl-0.9.6h
php-4.23
mod_perl-2.0
httpd-2.0.43
AP804_source
I have apache running ok and perl, but I can't get the hello world fil
On Fri, 2003-07-18 at 22:34, Ming Deng wrote:
> Ramprasad wrote:
>
> > else
> > Instead in your main program call
> > do "foo.pl args..."
> >
> > And in foo.pl set some scope defined variable like
> >
> > #foo.pl
> > $dbh=connect()
> > unless($dbh){
> > $GLOBAL::ERRORSTR="Couldnot connect
22 matches
Mail list logo