Re: Copying Hashes

2006-09-13 Thread lawrence
> Sorry for the bonehead question, but I have a hash called %p_mod. I > want to make a copy of it and edit the copy so that %p_mod stays the same. > > Currently, I'm creating %p_mod, writing > > %custom = %p_mod; > > to make a copy of %p_mod in %custom and then doing a bunch of stuff to > %c

Re: How to create XML files from simple plain text files?

2006-09-15 Thread lawrence
> > Yes, I have already checked the CPAN but I haven't found yet what I am > looking for. > Do you have to write my own script from scratch to convert plain text > files into XML files? Your question makes no sense. XML matching what doctype? What kind of plain text? -- To unsubscribe, e-

Re: if you use a module does this happen?

2006-10-14 Thread lawrence
Reading the fine manual will usually say if something inherits from something else. Failing that an examination of the source will elucidate. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roug

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread lawrence
eq. and comp.lang.c faq question 11.33 Short answer: In C, Don't Do That. By extension, don't do it in Perl. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components:

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread lawrence
and post increment. > So, I guess you have a much BETTER lesson to teach: Multiple assigments to a variable between sequence-points (to borrow from C terminology) can result in bizarre behavior and should be avoided. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Re: Evaluation of ++ different in C and perl?

2006-10-20 Thread lawrence
n the sense that it's > documented > to be broken. > > Rob No, it is not "clear" what the language "should" be doing. *EXACTLY AS IN C* multiple assignments within an expression is UNDEFINED behavior. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -

Re: Analize Java source file with perl?

2006-10-26 Thread lawrence
ut your program will fail (possibly spectacularly) on a java file that does not follow that rule. [1] More accurately, to the lexer and parser components of the compiler -- you can safely skip code generation. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence S

Re: foreach question

2006-10-31 Thread lawrence
a for loop. You can get away with the following, so long as @$servref has no undefined elements. while ( my $server = shift @$servref ) { . . . } -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists o

Re: Problrm compiling GD

2006-10-31 Thread lawrence
> Hi, > > I'm trying to compile GD-2.35 CPAN module, but i get this error: > > "make: *** [GD.o] Error 1" > > Nothing else. > I've tried lower versions, but still get trhe same error. > > I'm running RHEL 2.1with PERL 5.6.1 > > Any help would be appreciated. > > Before installing the GD Perl

Re: DB question

2006-11-06 Thread lawrence
, unwise, or evil. Until such time as they support it, when it suddenly becomes integral, intelligent and obviously correct. A couple of years ago, I was having an animated discussion with someone as to why my current employer used Pg instead of MySQL, and he said, "Well - we have [that

Re: Trouble installing module

2006-11-06 Thread lawrence
re.com/ and get a recent gcc for your platform and while you're there pick up .. well, just about everything else :) It's all in pkgadd format, and you should be able to spend about one day getting all the software you'd ever want on your machine installed without breaking a sweat. -

Re: Trouble installing module

2006-11-07 Thread lawrence
> In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] says... > > There should be a version of make in /usr/ccs/bin > > Giggidy! You're right! Thanks. > > > > I'm guessing I entered the wrong site name for the Perl CPAN module > > > config. Can anyone help me? > > > > Well, here's your Dolla

Re: Complicated sort

2006-11-09 Thread lawrence
#!/usr/bin/perl use strict; use warnings; my %monthmap = ( JAN => '01', FEB => '02', MAR => '03', APR => '04', MAY => '05', JUN => '06', JUL => '07', AUG => '08', SEP => '09', OCT => '10', NOV => '11', DEC => '12' ); my %reversemap = reverse %monthmap; my @sor

Re: Grep through a log file

2006-11-09 Thread lawrence
> I hope this is an easy one (I have a feeling it is). > > I'm trying to parse through a single, large firewall log file. I need > to run through a file to get the firewall name and push the associated > data to it's own log file. This is what I have so far: > > > #!/usr/bin/perl > > use warn

Re: Complicated sort

2006-11-09 Thread lawrence
> Ok, so now Lawrence would you be so kind as to give a little explanation as > to what is going on here? > > I can see that it works but to be honnest after the line: "my @sorted = " I > am lost... > > Thanks in advance, > > Rob Coops > > Okay ...

Re: Extract data from binary file

2006-11-09 Thread lawrence
> > Hi, > HI! And THANKS A LOT for posting your login/password pair -- I am sure many readers will have uploaded messages for your edification. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software

RE: hi?

2001-04-15 Thread Nic LAWRENCE
Absolutely not. > -Original Message- > From: the cut throat party (for self defense) > [mailto:[EMAIL PROTECTED]] > Sent: 15 April 2001 4:35 > To: [EMAIL PROTECTED] > Subject: hi? > > > > new to the list... anyone alive? > > Jim S. > > "getting drunk by yourself is not sick... >

RE: Perl CGI Security

2001-04-16 Thread Nic LAWRENCE
Actually that's a good question which I should look in to myself too. Especially seeing as I'm self taught .. (goes to check out the url you gave)... What type CGI are you going to be writing? > -Original Message- > From: Ray Calkins 100660207 [mailto:[EMAIL PROTECTED]] > Sent: 16 April

use strict;

2001-04-16 Thread Nic LAWRENCE
Thought I'd have a go at securing one of my scripts after Ray's question about security. When using "strict", I am told the following: Scalar value @views_keys[$k] better written as $views_keys[$k] at ./newremote2.pl line 327. Scalar value @_[0] better written as $_[0] at ./newremote2.pl line 342

RE: how to execute a windows 2000 command with perl

2001-04-19 Thread Nic LAWRENCE
Peter, You should have no problems executing binaries using the system() function,.. but if you're having problems with shell commands like "dir" etc, you should try something like: system("c:\winnt\system32\cmd.exe /c dir c:\mydir"); Alternatively there are modules available which will more th

RE: cat a file

2001-04-19 Thread Nic LAWRENCE
"copy /b" in windows is a binary copy eg. copy /b file1 + file2 file3 or "type" type file1 >> file2 maybe? what exactly are you trying to acomplish? I'm not at all sure you'll be able to combine .pst files outside of the application which built them > -Original Message- > From: Dr

RE: sysread and buffering

2001-04-24 Thread Nic LAWRENCE
Woah! Perl has a getc() function?!! /me goes to look it up! :) Schwing! > -Original Message- > From: Sean O'Leary [mailto:[EMAIL PROTECTED]] > Sent: 24 April 2001 10:16 > To: [EMAIL PROTECTED] > Subject: Re: sysread and buffering > ... > > But all that's moot, considering that Perl has ge

Sorting

2001-05-10 Thread Nic LAWRENCE
Can anybody suggest the most efficient method to do the following... I have an array of email aliases like the following: [EMAIL PROTECTED]: sys [EMAIL PROTECTED]: coookiecom [EMAIL PROTECTED]: niccicamcom [EMAIL PROTECTED]: katyland-

RE: check to see if file exists.

2001-05-10 Thread Nic LAWRENCE
Never seen system with that syntax before... here's what I'd do though: if (-e $file) { if (unlink $file) { warn "File $file WAS removed."; } } That's just my first guess though having not tested it. :) > -Original Message- > From: Peter Lemus [mailto:[EMAIL PROTECTED]] > Sent:

RE: Regexp Question

2001-05-10 Thread Nic LAWRENCE
How about this? if (/PT\s*\(?(\w+)\)?/) { $value = $1; } PTMatches the PT \s* Matches any number (or no) spaces \(? Matches one or none ('s (\w+) Matches one or many word characters \)? Matches one or none )'s $1Value caught by (\w+) I think. .. .. maybe. > At 05:13 PM 5/10/20

RE: Sorting

2001-05-10 Thread Nic LAWRENCE
Oooo... I like that... more or less the same as Peter suggested but a little more self contained ... gonna have to remember that kinda structure. thnx i'll try it out :) > -Original Message- > From: Paul [mailto:[EMAIL PROTECTED]] > Sent: 10 May 2001 10:41 > To: Nic LA

Re: How to delete an element in array?

2001-05-29 Thread Nic LAWRENCE
Ignore me if i'm talking poo, (especially since I didn't see the original message),... but surely splice() would be best suited for working with an ARRAY, but you all seem to be talking about hashes... sooo - Original Message - From: "Brett W. McCoy" <[EMAIL PROTECTED]> To: "Walt Ma

passing hashes between subroutines

2001-06-04 Thread Nic LAWRENCE
Is it possible to pass hashes between subroutines? When I try stuff like &foo(%bar); or return %bar; it doesn't seem to work how I would expect. :-/ Nic LAWRENCE <[EMAIL PROTECTED]> Technical Director TFBnet Internet Services http://www.niclawrence.co.uk eFax US: +1 (253)295

Merge documents

2001-10-02 Thread Lawrence Liew
Hi all, I'm trying to write a program to join up subdocuments into one full document. (all are RTFs) Is this more of a VB script stuff or can it be done with PERL? Thanks. Lawrence -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

regex

2002-01-03 Thread Lawrence Liew
Hi, I would like to match the following text (of different lines but standrad text) using regex. How can I do that? Status of this document This document is from an electronic database of legislation maintained by the Parliamentary Counsel’s Office of Western Australia. Disclaimer (a)no warr

Re: variables and sql-statements within perlscripts

2009-09-28 Thread Lawrence Statton
On Sep 28, 2009, at 11:01 AM, Ruprecht Helms wrote: Hi, How have I to write the sql-statement if I want to use variables like this: Don't.http://xkcd.com/327/ The value of the variable can have the value of another recordsetloop or a value come from outsite the script. Regards,

Re: Ternary operator: Am I missing something?

2010-03-29 Thread Lawrence Statton
On Mar 29, 2010, at 10:54 AM, r...@i.frys.com wrote: I looked through perlop and was unable to find where it stated that the ternary operator should only be used in an assignment such as you've shown. Can you point out where that's located. In my reasonably-arrogant opinion: That's kind of

Re: reference to subroutine???

2008-03-27 Thread Lawrence Statton
sanket vaidya wrote: >Whereas the output on perl 5.6.1 is > >Hello!!1 Ummm, beg to differ #!/usr/bin/perl use strict; use warnings; sub hello; my $ref = \&hello; &{$ref}; sub hello { print "hello!!"; } [EMAIL PROTECTED]:~$ perl -l pbml.pl hello!! [EMAIL PROTECTED]:~$ perl -v This is

Re: diff says memory exhausted need help with perl

2008-03-28 Thread Lawrence Statton
If you're using Gnu diff (i.e. the diff that comes with most Linuces) --speed-large-files might help you, without having to jump through a perl hoop. --L -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: $o->document vs $o->document()

2008-10-08 Thread Lawrence Statton
> I am using a module having documentation saying document() is a > method. However, I see it used as > > $o->document; > > Can you reference a method in this way? (I takes no args). I always > thought > > $o->document() and $o->document meant different things, function > verses attribute. >

Re: How to check empty hash value properly?

2008-10-08 Thread Lawrence Statton
> This distinction between canonical existence and logical existence--or > perhaps more properly the distinction between the existence of an > element and of a position--is important because, while useful, the > distinction does have implications for the value of $#array, the > return value of scal

Re: match and putting in a variable with a single statement

2008-10-24 Thread Lawrence Statton
> > I was just trying to match a string and save it in a single statement > as follows: > > $extracted = "cp xyz"; > $state_var = $extracted =~ m/cp\s+(.*)/; > print "$state_var $1 \n"; > > The output is: 1 xyz > > So the assignment to $state_var does not work. Is this an incorrect way. > The

Re: Question on subroutines

2004-11-30 Thread Lawrence Statton
On Tue, 30 Nov 2004 23:33:39 +, Jonathan Paton <[EMAIL PROTECTED]> wrote: > Dave, > > Yes, look up references in your books. > > E.g. > > sub example { > my @data = qw; > return [EMAIL PROTECTED]; > } > > my $reference = example(); > > for my $word (@{ $reference }) { > print "

Re: Search Tab-delimited file for Null fields

2004-12-01 Thread Lawrence Statton
hold my family my $people = []; $person->{hair} = 'blond'; $person->{name} = 'Lawrence'; $people->[0] = $person; Of late, I have gotten out of the habit of explicitly initializing lists or hashes, but I can see doing that piece of extraneous code to reinforce in th

Re: Reading external file. Open files from listing and do a search and replace then continue...

2004-12-01 Thread Lawrence Statton
> > Sure...if I know someone can do the job. I'll just go to rentacoder.com > > I'd be more than happy to consult for your Perl needs, send me an email > off list if you're interested. > > >>If not, "steal it from the market" might be more apt. > > > > > > So you don't take examples you find o

Re: Reading external file. Open files from listing and do a search and replace then continue...

2004-12-01 Thread Lawrence Statton
> > Got it so far. > > open CHECKFILE, "< file.in" or die qq(Cannot open file "file.in": $!); > @filecontent = ; > foreach $line (@filecontent) { > print " $line"; > } > close (INFILE); > > > The input file (list of files) looks something like this: > > P: 1

Re: pdf 2 bmp

2004-12-02 Thread Lawrence Statton
::Magick provides a Perl implementation that will call ghostscript for you. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions.

Re: Checking if a scalar value is a number or not

2004-12-02 Thread Lawrence Statton
$phrase = 'Anna would like a banana'; my ($greedy) = $phrase =~ /(.*)na/; my ($nongreedy) = $phrase =~ /(.*?)na/; print "Greedy: $greedy \nNongreedy: $nongreedy \n"; produces the output Greedy: Anna would like a bana Nongreedy: An -- -- -- -- -- -- -- -- -- -- -- -

Re: Making hash from two arrays

2004-12-02 Thread Lawrence Statton
ords (and THAT , class, is why embedded blanks in hash keys for positional parameters is a Bad Idea - because you can't use qw//) So, if instead of two parameters I had to pass a handful of parameters: some_graphic_function ( @opt{ qw / x_position y_position radius line_style color depth /

Re: [ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-02 Thread Lawrence Statton
> Casey West wrote: > > It was Wednesday, December 01, 2004 when Gunnar Hjalmarsson took the > > soap box, saying: > >> Casey West wrote: > >>> The original question was places squarely within reasonable query > >>> boundaries. > >> > >> What do you refer to as "the original question"? To me it's

Re: [ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-02 Thread Lawrence Statton
on is required or warranted. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: ftp script

2004-12-02 Thread Lawrence Statton
set binary mode. $ftp->binary || die "Could not set binary mode", $ftp->message; warn "Bin mode set ... " ; # # Now we are ready to get the file we want # $ftp->get('random_file.jpg') || die "Get failed ", $ftp->message; warn "Get c

META: Unreliable delivery

2004-12-02 Thread Lawrence Statton
rs later. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail

Re: Passing hashes as parameters to construct objects

2004-12-02 Thread Lawrence Statton
> > Is it something like: > [snippage snipped] > > TIA! > > > Regards, > Not a hash reference, a hash ... sub method { my ($class, %opt) = @_ ; . . . } -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL

Re: Making hash from two arrays

2004-12-02 Thread Lawrence Statton
*IS* much faster, but always leaves me with the feeling that it's overly obfuscated. (Although maybe if I forced myself to use it more often I'd be more comfortable with it... ) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/a

Re: $ID = $newcook{'usrID'}->value;

2004-12-03 Thread Lawrence Statton
n empty string if there is no cookie $ID = $newcook{usrID}->value if ref($newcook{usrID}); # if there is no cookie, $ID will be untouched (maybe undef?) $ID = ( ref($newcook{usrID} ? $newcook{usrID}->value : 'no cookie set yet' ); # $ID will get *SOME* value you can change

Re: Spam:Re: using $! for die()ing with Package function

2004-12-03 Thread Lawrence Statton
k and friends, or even taking the bigger step and start throwing exceptions. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. --

Re: setting more than 1 -domain=> in cookies

2004-12-03 Thread Lawrence Statton
I bring this up: You're going to spend a lot of effort to debug your cookie problem, perhaps to find later that some large segement of your population doesn't permit cookies). -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s

Re: perl questions.

2004-12-04 Thread Lawrence Statton
* another corner of Perl to explore, even if you've been living there for a long time. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal propo

Re: Tabulate data in a sequential file

2004-12-04 Thread Lawrence Statton
he line if ( my ($key, $value) = /(.*): (.*)$/) { warn "Got $value for $key"; push @{$data{$key}}, $value; } } warn Dumper \%data; __DATA__ key1: data1a key2: data2a key3: data3a key1: data1b key2: data2b key3: data3b .END PERL PROGRAM ..

Re: stat and chmod safety and prtability

2004-12-04 Thread Lawrence Statton
e) ", sprintf("%o", $mode),"\n" ; ... END PERL PROGRAM ... -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components:

Re: Tabulate data in a sequential file

2004-12-04 Thread Lawrence Statton
> Lawrence, > > Thanks for your explanation and pointers to perldoc, I can now manage > it basically. > > To print them out, now I use > > for ($i=0; $i<=$max_records; $i++) { >foreach $key (@keys) { > print $data{$key}[$i]; >

Re: close (...) or die "$!"

2004-12-04 Thread Lawrence Statton
a previous read or write operation, the OS may post an error when you attempt to close. Another possibility (although far-fetched): What if the filesystem goes away while you had it open? -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTEC

close or die() semantics

2004-12-04 Thread Lawrence Statton
. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: a warning which i can't understand

2004-12-04 Thread Lawrence Statton
print STDOUT (@list1), (@list2); # works again } .. END PERL PROGRAM ..... And upon running, we get: lawrence /tmp > perl test.pl print (...) interpreted as function at test.pl line 15. Useless use of private array in void context at test.pl line 15. Red

Re: Useless use of numeric gt (>) in void context and Useless use of private variable in void context

2004-12-05 Thread Lawrence Statton
Why don't you try trimming everything out except the block that encloses line 382 and post that. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zero

Re: Trouble with compound regular expression matching

2004-12-06 Thread Lawrence Statton
ter:\n"; for (@word) { print "$_\n" if /this|that/; } __END__ Produces the output: lawrence /tmp > ./test.pl Wrong wronger, wrongest: this that thit thas Better: this that -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: ip4 check

2004-12-07 Thread Lawrence Statton
($var)) { > print "your variable is a number $var\n"; > } else { > print "number $var is not a number\n"; > } 1) Read perldoc Net::IPv4Addr 2) change ipv4_checkip to ipv4_chkip -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Re: Need Help Installing DBI-1.46

2004-12-07 Thread Lawrence Statton
use) or (b) explicitly pass it to make. make CC=/opt/bin/gcc -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To uns

Re: Variables and MySQL

2004-12-08 Thread Lawrence Statton
" My gut (and many years of experience) tells me "putting a big fat database select in the middle of your route selection code is going to be a performance pig". Caching, caching, caching. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence

Re: Variables and MySQL

2004-12-08 Thread Lawrence Statton
Aww, dangit --- I should have not used __TARGET__ as the replacement tag -- there is just too much room for confusion with reserved words like __PACKAGE__ or __LINE__ ... Everyone take out your erasers and change that to --TARGET-- please :) --L -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Help with cookies

2004-12-08 Thread Lawrence Statton
fruit => 'citrus' ); @{$secure{USER_GROUPS}} = ( 10, 20, 30 ); warn Dumper \%secure; my $query = new CGI; my $cookie = $query->cookie (-name => 'cookie', -value => \%secure ); warn Dumper $cookie; warn $cookie->as_string;

Re: I am looking for a free perl compiler.

2004-12-08 Thread Lawrence Statton
demand for open-source source-closing software. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail: [EMAIL PRO

Re: Help with cookies

2004-12-08 Thread Lawrence Statton
again. Footnotes: [1] I actually think cookie paranoia is misplaced, and would love to see users educated -- but The Client Is Always Right, and if they say "Our industry demands no cookies" then so be it. There are other ways of keeping state, use them when you must. -- -- -- --

Re: I am looking for a free perl compiler.

2004-12-08 Thread Lawrence Statton
ld thinks pearl is something that grows inside an oyster and just want to have a dot-exe file they can download and run. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two component

Re: traversing (and accessing values in) a hash of hashes

2004-12-11 Thread Lawrence Statton
n" if $log{$key}{user_type} eq 'robot'; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to s

Re: traversing (and accessing values in) a hash of hashes

2004-12-11 Thread Lawrence Statton
192.168.1.1' => { user_agent => '...GoogleBot...', user_type => 'robot' }, '192.168.1.3' => { user_agent => '...Linux...Firefox...', user_type => 'human' },

Re: traversing (and accessing values in) a hash of hashes

2004-12-11 Thread Lawrence Statton
user_agent => '...Browser X...' }, { user_type => 'human', user_agent => '...Browser Y...' } ] ); How do you think you'd create that and iterate across

Re: Finding missing syntax element

2004-12-12 Thread Lawrence Statton
is a bad idea. One of the unspeakable horrors that was thrust upon me in my current job, was a chunk of 7,467 lines of code that is one enormous if/elsif/elsif/elsif/elsif/ block. Now it is 287 subs and a %dispatch table. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Re: Assigning a match to a varible without an IF

2004-12-13 Thread Lawrence Statton
rom_ is either your match or undef Which just allows you to defer the test for undef until later. print "I saw an email address $from_\n" if defined($from_); I just wrote about this a mere two weeks ago in this very forum. http://www.nntp.perl.org/group/perl.beginners/70671 -- -- -- --

Re: DBD::Oracle Instalation errors

2004-12-14 Thread Lawrence Statton
6:20: ocidfn.h: No such file or directory Well -- find those files... maybe your sysadmin installed Oracle's libraries in some non-standard place find / -name oci.h Then, fixup the incdir path, and try again. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence S

Re: How to detect present X-Server

2004-12-16 Thread Lawrence Statton
ut without ill effect) that allows me to SUPPRESS that automatic check is a GOOD thing. But requiring me to know that my $DISPLAY is set but unreachable is a stone in my shoe. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g C

Re: Resetting of the dataset

2004-12-16 Thread Lawrence Statton
) ); if ( my $cursor = $sth->execute ) { while (my $row = $sth->fetchrow_hashref) { . . . } } Of course, this just trades the KNOWN quantity of "straightforward memory for time" for a relatively unknown tradeoff on the database server. -- -- -- -- -- -- --

Re: variable declaration, was RE: moving to the next line

2004-12-17 Thread Lawrence Statton
; Class methods have uppercase forms: Employee->Create(); Functions/methods that return a list have plural noun forms: $division->Employees; $person->email_addresses. Well -- enough philosophy for one day ... -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Re: How to detect present X-Server

2004-12-16 Thread Lawrence Statton
ed `X'\n"; } ... END PERL PROGRAM ... -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is t

Re: Getting the prefered language of the browser

2005-01-12 Thread Lawrence Statton
rence (@preference) { print $preference->{language},"\n"; } --- end perl code --- Plugging this into a CGI and doing something useful with it is, as they say, left as an exercise to the reader. -- -- -- -- -- -- -- -- -- --

Re: A second beginner's question

2005-01-14 Thread Lawrence Statton
er message I didn't find in > perldiag. > You have a few TOO many 'my's ... your problem is all revolving around scoping. In the sort snippet you say my @newgroup = (@oddgroup, @evengroup) and then in the very next line destroy @newgroup by closing the block. Using lexi

Re: A Beginner's problem

2005-01-14 Thread Lawrence Statton
rogram does nothing useful"; -- ... put it into your crontab and see what happens. Reading the man page for your system's cron will also be enlightening. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software

Re: perl script to binary executible

2005-01-24 Thread Lawrence Statton
a single .EXE file they can just run, without having to install Perl. The comes-with perlcc will function for those cases where "I just want to save myself the support hassle of casual users tweaking the script." -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- L

Re: hash slice/exists vs. grep benchmark weirdness...

2005-01-24 Thread Lawrence Statton
ut its consistently faster by an average 6-10% > > Any ideas why that might be? Well, first -- you're creating the hash inside the benchmark loop, which is not particularly light-weight. Second: You're using pathologically small lists. Try running it with 10,000 elements

Re: hash slice/exists vs. grep benchmark weirdness...

2005-01-25 Thread Lawrence Statton
ash version was about 10 times faster for *JUST THE SELECTION OPERATION* than the grep-the-list version. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them

Re: hash slice/exists vs. grep benchmark weirdness...

2005-01-25 Thread Lawrence Statton
-long and randomly-variable amount of time (printing) inside the function you are trying to test, you are basically destroying the exact number you are trying to compute, and have merely computed the deviation of the print operator. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Re: Hash Getting Doubled?

2005-01-31 Thread Lawrence Statton
sort keys %capdef ) { } -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: perl and PostgreSQL?

2005-02-01 Thread Lawrence Statton
> Hi, > can anybody address me to online resources to learn how to connect to a > PostgreSQL DB server through a Perl script? > Code examples are welcome ;-) > TIA > - begin perl code --- #!/usr/bin/perl use strict; use warnings; use DBI; our $_db

Re: Premature end of script headers

2005-02-08 Thread Lawrence Statton
t; > Thnx in advance Yes. The cause of this is the script headers are ending prematurely. If you would rather have *USEFUL* answers to stupid questions, including some code to elicit the error would be reccomended. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Re: Problem with script requiring valid referrer

2005-02-08 Thread Lawrence Statton
ere who configure their browsers to either not issue referrer at all, or tomangle it in an effort to obfuscate their activities. My instinct tells me: If the CGI::referrer() call is not giving you what you want, then it's unlikely that the browser is correctly passing in the header. -- -- -- -- --

Re: Undef value trouble

2005-02-18 Thread Lawrence Statton
ne record because it has the "0" value. > How could I pass this situation? > while ( defined ( my ($pid) = $sth->fetchrow_array ) ) { } -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software c

Re: tricky hash

2005-03-08 Thread Lawrence Statton
series of data indexed by a monotonically increasing integer. The List. my @keyword = split ( /\//, 'something/wicked/this/way/comes' ) ; If you like the refence version of it my $keywords = [ split (/\//, 'something/wicked/this/way/comes') ] ; -- -- -- -- -- -- -- -- -- -- --

Re: Testing for a '\' in a string

2005-03-09 Thread Lawrence Statton
' ) ; foreach my $directory (@directory) { print "before: $directory\n"; $directory .= '\\' unless $directory =~ m/\\$/; print " after: $directory\n\n"; } == end code Produces the following output lawr

Re: NIC Cards

2005-03-09 Thread Lawrence Statton
y listen on a given address. Getting the IP-addresses for the various interfaces on your system is left as an exercise to the user. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two comp

Re: NIC Cards

2005-03-09 Thread Lawrence Statton
5.456'))) || die "bind: $!"; between the calls to socket() and connect(). Obviously you'll need to replace that bogus IP-addr with the ip-addr of your local interface. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s

Re: Passing parameters into post

2005-03-09 Thread Lawrence Statton
ides a helper function POST that will generate a properly formated HTTP::Request object. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into th

Re: PDF creation

2005-03-09 Thread Lawrence Statton
) would give me > better mileage. > I use PDF::API2 every day and love it. The documentation is horribly lacking (Track down the example files - that is the best doco there is), but the library can do it all. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Re: Use of uninitialized value

2005-03-17 Thread Lawrence Statton
amp;& $value eq 'spring' ) { print "Flowers are in bloom\n"; } else { print "No flowers here!\n"; } -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal

Re: Database -> Excel

2005-03-31 Thread Lawrence Statton
dsheet::WriteExcel -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail

  1   2   3   >