e snippet 1
> open(FILEH, "database/$_") or die "$!";
> while (sysread FILEH, $buffer, 4096) {
> $lines += ($buffer =~ tr/\n//);
> }
> close FILEH;
> $lines = 0 if !$lines;
> print " - $lines entries\n";
>
> #code snippet 2
> open(FILEH, &q
ice for telling users if they've got it wrong. If you're
> going to trust it, you're on crack.
>
> Hope This Helps
>
> {Pete
>
>
> -------
> ($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
> yvlkbfdtcierstajogvPruntRshackRJelov')
>
}
> }
> close(FH);
> }
> }
> closedir(DIR);
>
>
> So if I have only five files to check against a hundred I'm lost. Please
> help!
>
> George Sala
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
rch a MYSQL database
> for a particular username and look for for the expiry date and compare it
> with the current date to determine whether expired or not. Any help will be
> appreciated or a website that could give me some hints.
>
> Thanks
>
> Ackim
--
Ondrej Par
Internet Sec
enviroment variable is a security risk. The alternative below is much
better.
> or:
>
> # prog1
> use Storable 'freeze';
> $ENV{ARRAY} = freeze \@array;
>
> # prog2
> use Storable 'thaw';
> @array = @{ thaw $ENV{ARRAY} };
>
> The
the cgi script the way the index.html page tells it to. ALL of the
> directories are recursively set up in apache. Why does it serve the script
> itself like text? Do I need to define the type in the second line of the
> script? HAS ANYONE had this issue?
>
> Ken
--
Ondrej Par
Int
otherwise you are storing a list into scalar variable and that does not work
(you could also replace commas with dots, but join() is far cleaner).
Also, it's better to rewrite for() as
foreach my $g (0..$#topten)
((the same applies to previous for()).
Also, maybe it's a bit more flexible to store @topten lines without the
newline, and then print them out with
print map "$_\n", @topten;
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
same applies to @array.
Is it clearer now?
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
because $action is undefined. Comparing undefined value
with something is usually unwanted, so it produces a warning.
You could rewrite it to:
if (defined($action) && ($action eq 'add')) {
or assign something meaningful to $action before you use it.
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
RECHE gallardo, pHDTL: 617 632
> 3824
> Scientist, Mol.Immnunol.Foundation, FX: 617 632 3351
> Dana-Farber Cancer Institute, EM:
> [EMAIL PROTECTED]
> Harvard Medical School, URL: http://www.reche.org
> 44 Binney Street, D610C,
> Boston, MA 0
uest.conf";
> my %conf = ();
> my $varValueSep = '==';
> my $confComment = '#';
>
> processConfFile (\$configFile, \%conf, \$varValueSep, \$confComment);
>
That's really strange. Maybe you could print $input before the line, and then
print $var and
plaining about? And what
> the heck is a chunk?
1) warnings do not prohibit the execution. they are just warnings, not errors.
2) variables are initialized, but some of them are initialized from the
parameters. So, if you pass undefined value as a parameter, the variable can
contain undefine
CGI scripts usually use CGI module, which
provides all the tools for accessing useful data in the query.
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
s:
>
> $prep_query="SELECT school_name, path from student_data where
> student_id=$student_id";
> $query=$dbh->prepare($prep_query);
> $query->execute;
> ($school,$path)=$query->fetchrow_array();
>
> Any easier ways to compact this one would also be terrific.
irectory isn't set correctly? If this is you case, use chdir() function.
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
;]*)*)"/gc or
I think that
/\G\s*"((?:(?:\\.)|[^\\])*?)"/gc
is shorter and also matches all \X sequences (the trick is that \\. is longer
than [^\\]
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
f there is a duplicate, nothing is written to the new file. The real
> file 1 I'm dealing with has more than 2 million rows and the real file 2
> has more than 100,000 rows so I don't think my method is very efficient.
> I've looked through the web and perl references and c
'use', you are saying what should be the name of .pm
file with module - and it's IO::Socket. Inside that file, there is defined
package IO::Socket::INET (among other things). In short: package file name
does not necessarily have to match package name.
--
Ondrej Par
Internet Secur
gt; /\G\s*'(.*?)'/gc or
> /\G\s*(\S+)/gc;
>
> print map "<<$_>>", @elements;
>
> The use of scalar /\G./gc to inchworm along a string is a powerful
> technique.
Yes, this is better. With one exception - you're not handling \' and \
) {
> until (!defined($pair[$i])
>
> || !defined($pair[$i+1])
> || $pair[$i] =~ /['"]$/) {
>
>$pair[$i] .= " " . $pair[$i+1];
> splice @pair, $i+1, 1;
> }
> $i++;
> }
> }
>
> print "$_\n" for (@pair)
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
the problem
by yourself :)
Ondrej
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
)
> > {
> > push @replies, <$_> ;
> > }
> > }
> >
> > Problems:
> > print statements (not shown here) tell me that
> >
> > 1) Socket appears to block, although @ready should
> > only contain a list of readable filehandles.
> >
> > 2) If Server closes the connection, the while
> > condition evaluates to true always and it loops
> > forever.
>
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
You're right. But in my job, I often process DOS files on Linux server, thus
I learned to be extremely careful with line endings :)
On Friday 01 June 2001 15:15, Randal L. Schwartz wrote:
> >>>>> "Ondrej" == Ondrej Par <[EMAIL PROTECTED]> writes:
>
&g
On Thursday 31 May 2001 22:30, Ken wrote:
>
> If you're reading this input from a file maybe try using a chomp?
chomp isn't always good. It's better to use
s/\r?\n?$//;
or even
s/\s*$//;
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Pho
array containing the logical volumes held
> on the phsical one, but I can't get the syntax right. I tried
>
> push @$pvolumes{$pv}->{volumes},"$lv:$lp:$pp:$dist";
> push $pvolumes{$pv}->{volumes},"$lv:$lp:$pp:$dist";
>
> and
>
> push @$pvolume
1) better use
$data = < The following seems to never break out of the loop,
> any comments?
> Thanks
>
> Dave
>
> #!/usr/bin/perl -w
>
>
> $data = 'some
> multi line
> string';
>
>
> while($data){
>
>push(@everyline
won't find this message too annoying :)
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
GV && (-T $ARGV[0]))
whatever seems more intuitive (second form uses @ARGV in scalar context, thus
converting it to number of elements).
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
I was reading up on sockets but i found them a bit
> confusing. Some assistance with sockets would be very helpfull.
>
> thanks,
> Jason
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
29 matches
Mail list logo