Re: # of lines in file

2001-07-16 Thread Ondrej Par
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

Re: CGI.pm and form validation

2001-07-16 Thread Ondrej Par
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') >

Re: newbie: help with file search

2001-07-16 Thread Ondrej Par
} > } > 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]

Re: Searching a MYSQL database

2001-07-16 Thread Ondrej Par
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

Re: passing an array ref by environment variables

2001-07-16 Thread Ondrej Par
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

Re: from one problem to the next emumail...

2001-06-26 Thread Ondrej Par
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

Re: arrays and formatting

2001-06-15 Thread Ondrej Par
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

Re: Use of uninitialized value in string eq at ./adpanel.pl line 37.

2001-06-08 Thread Ondrej Par
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

Re: Use of uninitialized value in string eq at ./adpanel.pl line 37.

2001-06-08 Thread Ondrej Par
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

Re: SWAPING COLUMNS

2001-06-08 Thread Ondrej Par
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

Re: Need help interpreting a warning

2001-06-08 Thread Ondrej Par
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

Re: Need help interpreting a warning

2001-06-07 Thread Ondrej Par
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

Re: the ENV command? parameter?

2001-06-07 Thread Ondrej Par
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

Re: Getting results from MySQL

2001-06-07 Thread Ondrej Par
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.

Re: system

2001-06-07 Thread Ondrej Par
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

Re: splitting strings with quoted white space

2001-06-07 Thread Ondrej Par
;]*)*)"/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

Re: Comparing two files

2001-06-06 Thread Ondrej Par
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

Re: IO::Socket::INET cannot find despite existence

2001-06-06 Thread Ondrej Par
'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

Re: splitting strings with quoted white space

2001-06-06 Thread Ondrej Par
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 \

Re: splitting strings with quoted white space

2001-06-06 Thread Ondrej Par
) { > 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

Re: Real new.... sub not working correctly.

2001-06-04 Thread Ondrej Par
the problem by yourself :) Ondrej -- Ondrej Par Internet Securities Software Engineer e-mail: [EMAIL PROTECTED] Phone: +420 2 222 543 45 ext. 112

Re: IO::Select problems

2001-06-04 Thread Ondrej Par
) > > { > > 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

Re: Printing has me confused

2001-06-01 Thread Ondrej Par
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

Re: Printing has me confused

2001-06-01 Thread Ondrej Par
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

Re: array inside a hash

2001-05-31 Thread Ondrej Par
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

Re: iinfinite loop

2001-05-30 Thread Ondrej Par
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

Czech speaking Perl help-desk

2001-05-30 Thread Ondrej Par
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

Re: Cleaning up 'uninitialized value'

2001-05-30 Thread Ondrej Par
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

Re: Sockets help

2001-05-30 Thread Ondrej Par
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