flock() semantics?

2003-10-30 Thread Shaun Fryer
alue$/ ); } flock(OUT, LOCK_UN); close(OUT); } Btw, the above code is just to illustrate the question, thus no error checking and so forth. -- = Shaun Fryer = http://sourcery.ca/ ph: 905-529-0591 = Science is like sex: occa

Re: Form creation and parsing

2003-10-10 Thread Shaun Fryer
, I'd recommend two other modules which I've found myself becoming excedingly attached to, CGI::Session and HTML::Template. They may have a slightly steep learning curve if you're new to perl, but the time savings should make it well worth the effort. -- = Shaun

Re: show job status

2003-10-03 Thread Shaun Fryer
in script you would check the contents of the temp file every second or so and print a generic status message (ie. "searching db...") until the job is complete, when it then prints the final search results. Comments are welcome from more experienced parties. -- = Sha

Re: printing FILE HANDLE to mail

2002-05-17 Thread Shaun Fryer
t To: Unix Admin <$unixadm> Subject: $subject Hello $text EOF -- === Shaun Fryer === London Webmasters http://LWEB.NET PH: 519-858-9660 FX: 519-858-9024 === -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

SFTP

2002-05-15 Thread Shaun Fryer
Does anyone know off hand if there is a Perl Module for negotiating and scripting SFTP connections? === Shaun Fryer === London Webmasters http://LWEB.NET PH: 519-858-9660 FX: 519-858-9024 === -- To unsubscribe, e-mail: [EMAIL PROTECTED

reading multi-line into an array

2002-05-13 Thread Shaun Fryer
calar value. That works okay for most purposes, but for the shere fun of it, I want to try doing it a little differently. Comments? === Shaun Fryer === London Webmasters http://LWEB.NET PH: 519-858-9660 FX: 519-858-9024 === -- To unsubscri

Re: checking if domain or IP address

2002-05-01 Thread Shaun Fryer
=~ /\d/) { $IP = 'yes'; } else { $IP = 'no'; } Validating Domains and IP's is alot more intensive, because there are numerous (and occasionally changing) factors to check for. === Shaun Fryer === London Webmaste

Re: assigning array to hash

2002-04-29 Thread Shaun Fryer
of JustRef Shouldn't the second last line read... --- my @new_array = @{$hash{$jref_key}}; --- ? It looks like JustRef() is creating @new_array based on the hash value previously created in refFunc(). ======= Shaun Fryer === London Webmasters htt

Removing ^M (Carriage Return) from files on *nix

2002-04-26 Thread Shaun Fryer
Someone mentioned this problem recently. Here's a solution. Open the file in vi and type... :g/[Ctrl+v][Ctrl+m]/s/// That will remove all the Carriage Returns from the file in one shot. === Shaun Fryer === London Webmasters http://LWEB.NE

Re: assigning array to hash

2002-04-26 Thread Shaun Fryer
e array from the key's value later on, you just split(/\|/,"$hash{some_key}"). I typically do this when writing berkley db's which need to have variable length arrays as the values of a list of keys. You'll have to pick a delimiter that won't exist within $value.

RE: evaluating multiple conditions

2002-04-23 Thread Shaun Fryer
ome_func. In the > first instance, some_func has access to the arguments of the calling > function. Good to know. What happens in the case where I do something as follows (which I do often and so far successfully).. &some_func("$var1","$var2","$var3");

Re: RegEx question

2002-04-23 Thread Shaun Fryer
utine. use CGI; CGI::ReadParse(*formdata); ======= Shaun Fryer === London Webmasters http://LWEB.NET PH: 519-858-9660 FX: 519-858-9024 === -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

commenting perl

2002-04-23 Thread Shaun Fryer
Is there a simple way to comment multiple lines in Perl in a like manner to the "/*" or "

RE: evaluating multiple conditions

2002-04-23 Thread Shaun Fryer
it inefficient? How about this... if ($something =~ /(^string0$|^string1$|string2)/) { I'm still learning and ironing out alot of my understanding of proper syntax (especially since I've canabalised alot of Perl4 stuff until recently), so I appreciate your indulgence. You've already helped me immensely. === Shaun Fryer === London Webmasters http://LWEB.NET PH: 519-858-9660 FX: 519-858-9024 === -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

evaluating multiple conditions

2002-04-23 Thread Shaun Fryer
uge I've been doing as follows. my $test_ok; $test_ok = 1 if ($something eq 'string0'); $test_ok = 1 if ($something eq 'string1'); $test_ok = 1 if ($something =~ /string2/); if ($test_ok) { &do_something; } else { &do_somthing_else; } Is there a better way

CGI::ReadParse

2002-04-14 Thread Shaun Fryer
Parse module. I figured it would be as simple as replacing.. require 'cgi-lib.pl'; &ReadParse; ...with.. use CGI; CGI::ReadParse; However now when I try to grab a value using $in{key}, all I get for output is: @dmd ` Does anyone have a clue what I'm missing?

Security question re POST data

2002-04-11 Thread Shaun Fryer
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $name =~ s/\n//g; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/\n//g; $value =~ s///g; # disallow SSI

extracting params to a hash

2002-03-05 Thread Shaun Fryer
I'm trying to convert an old script that used cgi-lib.pl over to using CGI.pm. In order to save time I'd like to simply do something like what follows (though that doesn't actually work it seems). %in = param; Any ideas? ======= Shaun Fryer === Lo

RE: Writing file to Windows

2002-02-26 Thread Shaun Fryer
I know this is probably kindergarten to most of you, but if I had to do it (I only use Unix) and strip all the HTML, I'd simply do the following. $url = 'http://domain/path/to/file'; $file = `lynx -dump $url`; print $file; ======= Shaun Fryer === Lo

Re: Time sensative Sub Routine

2002-02-22 Thread Shaun Fryer
) conversion in reverse is a little tedious to work out, but it functions very reliably once you get it down. ======= Shaun Fryer === London Webmasters http://LWEB.NET PH: 519-858-9660 FX: 519-858-9024 === -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: convert array to integer

2002-02-22 Thread Shaun Fryer
Try this little baby. @array = (5, 6, 7, 8); $integer = print(@array); chop($integer); === Shaun Fryer === London Webmasters http://LWEB.NET PH: 519-858-9660 FX: 519-858-9024 === -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Need help with if statement - please

2002-02-22 Thread Shaun Fryer
this. It's not exactly "realtime", but it will give you a realistic visual status. $Count = 4; # or any desired number of ICMP requests print `ping -c$Count domain.tld`; === Shaun Fryer === London Webmasters http://LWEB.NET PH: 519-858-9660 FX: