Re: Case statements

2005-04-12 Thread Jonathan Paton
On Apr 12, 2005 4:24 PM, David Gilden <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to create case statement, and I am not sure I am on the right > track, > any comments? perldoc Switch Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9

Re: pointers - references ??

2005-04-11 Thread Jonathan Paton
{deep}{hash} is a hash reference) This will speed things up, and perhaps make code more readable. I'll leave you to read up on how Perl does OO... not pretty but an interesting and powerful approach. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+1

Re: Capturing the integer return value of a "C" program, called inside perl script

2005-04-10 Thread Jonathan Paton
> I want to capture the return value of a "C" program > called inside a perl script. How to do this? perldoc -f system To find out that you need $? and/or ($? >> 8). Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-

Re: Statistics::R

2005-03-27 Thread Jonathan Paton
Can't call method "startR" on an undefined value at (eval > 10)[/usr/local/lib/perl5/5.8.5/perl5db.pl:620] line 2. Read the documentation: http://search.cpan.org/~gmpassos/Statistics-R-0.02/lib/Statistics/R.pm Note the 0.02 version number - you may have a rough ride. Jonathan P

Re: suidperl.

2005-03-27 Thread Jonathan Paton
robably be better > > than any suid program. > > Yes, i had consider this option too, maybe this can be the better > solution, but what do you say about a C wrapper? Depends on your knowledge of C security issues. A carefully written C wrapper is going to be more secure than a caref

Re: suidperl.

2005-03-27 Thread Jonathan Paton
unt. * Using the existing samba web administration interface is not possible - even if automated. I would consider changing the group of smb.conf to say "lp", then the permissions to 664. That would probably be better than any suid program. Jonathan Paton -- #!perl $J=' '

Re: Simplify perl -e '$a = [1,2,3,4,7]; print $a->[$#{@$a}]'

2005-03-12 Thread Jonathan Paton
27; for 1, 3, 0, 2; The eval is required because you can only set $_ to a constant value. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(

Re: IO::Socket::UNIX questions

2004-12-31 Thread Jonathan Paton
guess that named pipes and anonymous pipes are implemented using the same code. The difference is how the connection is established. UNIX vs INET is another story. On loopback, I guess INET would easily achieve 100MB/sec, and I think UNIX domain sockets would be faster still. Jonathan Paton -- #

Re: IO::Socket::UNIX questions

2004-12-30 Thread Jonathan Paton
INET sockets? I believe so, but the difference might not be that great. Which seams more appropriate? May the man pages help you in your quest. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 0

Re: How to create and use external modules with ActiveState Perl 5.8+?

2004-12-29 Thread Jonathan Paton
an avoid having to ask. Perhaps the example had a misprint. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/( \d+) (.+) /x,, vec$ J,$p +=$2 ,8,=

Re: Variable Value into MySQL DB

2004-12-27 Thread Jonathan Paton
#x27;t rely on nobody noticing. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/( \d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,, --

Re: pattern matching question

2004-12-23 Thread Jonathan Paton
> i'm trying to figure out how to split a file delimited > by commas and newlines. Sounds like a CSV file to me, and for those you look on CPAN for a ready made solution. http://search.cpan.org/search?query=CSV&mode=module Jonathan Paton -- #!perl $J=' 'x25 ;for (qq&

Re: Accessing DLL functions

2004-12-23 Thread Jonathan Paton
m easy (if you get Win32:API or similar to do it) to hard (writing drivers or using the XS layer). I am not qualified to write about Win32::API. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00

Re: Uninitialized value in unpack

2004-12-23 Thread Jonathan Paton
quot;, unpack('C4', $ip); } $resolved{$name} = $ip; } Notice I have introduced a more meaningful loop variable, removed "" as the default and used a hash instead. I suggest you have the code reviewed. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10

Re: Converting a array to a scalar

2004-12-23 Thread Jonathan Paton
dd it on. If you need more information, please include the module name you are using. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/( \d+) (.+)

Re: Word Automation through Win32::OLE

2004-12-22 Thread Jonathan Paton
scoped, using my, then you wouldn't have to undef them. With strict you will HAVE to learn to use "my" and "our". > } > } > So, the main lesson of the day is USE STRICT. You will save days of debugging, which must qualify as being kind (if not gentle ;-) Jon

Re: Calculating week numbers across years

2004-12-21 Thread Jonathan Paton
your real problem is when you have week 53. I think you need to only accept the same or next year for today, and make adjustments if week 53 crops up. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4

Re: trying to chroot perl and its modules

2004-12-18 Thread Jonathan Paton
temporary directory. Debugging this would be too much like work, maybe someone else would be interested. Sorry. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\

Re: trying to chroot perl and its modules

2004-12-18 Thread Jonathan Paton
he chroot jail. chroot should never be an excuse for running untrusted or poor quality software. It is simply another layer of security, which usually restricts damage if the code is exploited. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 0

Re: Dynamic Splice

2004-12-17 Thread Jonathan Paton
> Is there a way to build splice portion: [9,10,11,15,25,28,31,32,34] > ... Yes, put those in an array. Like: my @array = (9,10,11,15,25,28,31,32,34); my $spliced = @[EMAIL PROTECTED]; Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+1

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

2004-12-17 Thread Jonathan Paton
h google for others! > Perl is an eccentric language to be sure, ... Not as much as the programmers that use it ;-) Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4 00+8 1-21 01+1 00+5 01-

Re: combining getc() and unicode strings problem?

2004-12-16 Thread Jonathan Paton
ou have worked on the problem first. Minimum boilerplate for all scripts should be: use strict; use warnings; Documentation available via perldoc. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4

Re: combining getc() and unicode strings problem?

2004-12-16 Thread Jonathan Paton
. Why are you doing this? Is most of your experience with C? Jonathan Paton On Thu, 16 Dec 2004 19:18:06 +0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > i have intensively searched the web for a solution on the following problem, > but could not find any

Re: find sub {}

2004-12-16 Thread Jonathan Paton
mplete pathname (including filename) plus "/passwd", if that directory exists for reading. Or more clearly: if (-r "$_/password") { $chambers{$filename} = "$fullname/passwd" } The documentation for File::Find is the key to your troubles. Jonathan Paton -- #!perl $

Re: How to detect present X-Server

2004-12-16 Thread Jonathan Paton
d and try. If the toolkit returns an error then you know you don't have one. In the situation you want to use X if available, terminal otherwise, wouldn't it be better just to use an option? More detail, better answers! Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+

Re: receiving input from different sources

2004-12-15 Thread Jonathan Paton
n the new process will reopen STDIN with input coming from the keyboard. Or something like that. I think you need to search for unix systems programming (in C). Once you know how it is done in C, work out how to do the same in Perl. Jonathan Paton [Writing of things I have little experien

Re: Finding missing syntax element

2004-12-12 Thread Jonathan Paton
also diff against a previous version. You could split your long(ish) script down in to smaller parts. If you are really stuck, and you ARE using whitespace effectively, then send a copy to MY mailbox (***NOT THE LIST***). Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

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

2004-12-11 Thread Jonathan Paton
( { ip => ..., agent => ..., type => ... }, ... ); Then you could do: my @robots = grep { $_->{type} eq "robot" } @array There are MANY alternatives. --- A word about the task: What happens when multiple agents use the same IP address? Jonathan P

Re: LWP::UserAgent -> Not in this case?

2004-12-09 Thread Jonathan Paton
Hi, I can only guess at the source of the problem. I think it is because that web site requires cookies. The solution is to have a cookie jar, like: my $agent = LWP::UserAgent->new(); $agent->cookie_jar({}); Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-

Re: Good examples of POD for newbies?

2004-12-09 Thread Jonathan Paton
Dear Kevin, There are thousands of examples of POD on CPAN. E.g. http://search.cpan.org/src/DCONWAY/Parse-RecDescent-1.94/lib/Parse/RecDescent.pod Jonathan Paton On Thu, 09 Dec 2004 09:17:50 -0500, KEVIN ZEMBOWER <[EMAIL PROTECTED]> wrote: > Can anyone suggest a small mod

Re: Need advanced help with tracking down warnings in eval'd functions

2004-12-09 Thread Jonathan Paton
od as my Perl ;-) Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Term::ReadKey substitute for perl v5.8.0

2004-12-08 Thread Jonathan Paton
27;m trying to wrap the ReadKey call in an infinite loop, but it breaks > as soon as I add the loop. Take away the loop, or convert the ReadKey > to blocking, and it works just fine. Here's the test code snippet I'm > using: Jason, Have you tried placing the two Read

Re: Help with cookies

2004-12-08 Thread Jonathan Paton
Dear John, It is likely that you cannot store complex datastructures in cookies. (at least how the CGI module is currently written). You could try encoding the data to a string. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: I am looking for a free perl compiler.

2004-12-08 Thread Jonathan Paton
grammers, but not the type people hire to reverse engineer. Obfuscated code is likely to be poor quality code (lack of pride - bugs hidden away). http://www.stunnix.com/prod/po/sample.shtml Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: Need help with Curses

2004-12-07 Thread Jonathan Paton
be more useful to other projects. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/( \d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} w

Re: Help optimizing script

2004-12-07 Thread Jonathan Paton
die "Invalid output from ifconfig! Received: $ppp0\n" } Reason: By using a postfix conditional, you are placing emphasis on the error message not the condition that follows it. I wouldn't normally expect a postfix conditional to also have important side effects. You may not agre

Re: Monitor Squid access.log

2004-12-07 Thread Jonathan Paton
you can just sleep for a second or two and then retry. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4 00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/( \d+) (.+) /x,, vec$ J,$p +=$2 ,8,

Re: File generation not working

2004-12-07 Thread Jonathan Paton
t mode goes even further. Also consider where you want to display your errors. Usually, if you die in a CGI script then the server logs get the die message. The user gets 500 - Internal Server Error and little else. Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7

Re: String to Character Array

2004-12-06 Thread Jonathan Paton
@array = split //, $string; Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: [Released] [Contains offensive content] RE: Building Network Redundancy into a Perl Client

2004-12-06 Thread Jonathan Paton
Dear Graeme, The problem is with your employers filtering software, as the copy of the same message I received was unaltered. Perl beginners is not the place to ask about this. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <h

Re: built-in switch statement?

2004-12-06 Thread Jonathan Paton
ight" (and "track"). This RFC is essentially that design (not surprisingly, since Damian wrote it), so it will be accepted, albeit with several tweaks. " Link: http://dev.perl.org/perl6/apocalypse/A04.html Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: a warning which i can't understand

2004-12-05 Thread Jonathan Paton
rint scalar (('Jan', ...)[-1]); Or even: print + (('Jan', ...)[-1]); As always there is plenty of alternatives. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Is try-catch a better method for handling errors ?

2004-12-04 Thread Jonathan Paton
monly used. A better way is to use the Error module. perldoc Error Sidenote: Consider transactions if your DB supports them, depending on what you are doing. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.per

Re: Newbie having problems replacing text

2004-12-03 Thread Jonathan Paton
itle? Not until after you find the tags! Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: push hash to array

2004-12-03 Thread Jonathan Paton
> Example, which works: > > %hasha = ( 'b' => 'c', 'd' => 'e' ); > %hashb = ( 'f' => 'g' ); > @array = ( \%hasha ); > push (@array,\%hashb); Also can be written as: my @array = { b => 'c',

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

2004-12-02 Thread Jonathan Paton
perldoc Carp; If that doesn't do what you want, then: perldoc -f eval else just set $@ and return undef. This is a bad solution I think. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org

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

2004-12-02 Thread Jonathan Paton
> if I make a module, say Foobar.pm how do you make it so if a function > returns false you can die $!; ? Return undef or 0, just like you are doing. Both your calls to baz have an argument, so 1 is returned both times. I prefer undef for false. Jonathan Paton -- To unsubscribe,

Re: How to ppm GD? (was RE: How to install GD for bugzilla)

2004-12-02 Thread Jonathan Paton
For the 5.6 PPM repository, use: ppm install http://theoryx5.uwinnipeg.ca/ppmpackages/GD.ppd __END__ Talk about pain! I couldn't install it due to (Bad protocol 'tcp') messages. You don't mention anything like that, so maybe... just maybe you'll get GD installed. Jo

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
is one a thousand times over. Looking at RT for perl 5, the first bug report was in 1999! Maybe the fix is to make the regex engine significantly slower - hence no action. Alternatives are quicker anyway. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
didn't manifest itself with your code. I strongly recommend perlbug. I will add to it. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
et 2.6.5-1.358 #1 Sat May 8 09:04:50 EDT 2004 i686 athlon i386 GNU/Linux Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: How to install GD for bugzilla

2004-12-02 Thread Jonathan Paton
e, it is a script that passes configuration data to the compiler. Many other libraries use a similar script. You need to include this... but you have additional problems if it's written in sh. I would expend my effort on getting GD using PPM. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL

Re: removing line from a file

2004-12-02 Thread Jonathan Paton
PS: The Perl Cookbook (May 1999 edition) describes all three of the techniques properly in recipe 7.8, 7.9 and 7.10. I recommend the cookbook if you don't already have it. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: removing line from a file

2004-12-02 Thread Jonathan Paton
inal or the changed version - not somewhere in between. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: the case of "-pe" and "-ne" swtich in Perl one liner

2004-12-02 Thread Jonathan Paton
D] mailing list now [EMAIL PROTECTED] for perl golf]. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: subroutine problem

2004-12-01 Thread Jonathan Paton
Dear Mike, Surprised you've been stumped for 3 hours, but sometimes the most obvious bugs are the hardest to find. In your code you have: ... &printSequence; foreach my $id (@list) { ... That function call is causing your problem. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL

Re: Source Code Audit

2004-12-01 Thread Jonathan Paton
older versions of perl I found eval leaked badly (a simple loop with eval) ballooned well beyond 100Mb... and climbed. How much code is involved? Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/>

Re: File Upload Using CGI

2004-12-01 Thread Jonathan Paton
Dear Manas, Use the CGI module, which provides a upload() method. In fact, I googled about for a tutorial that didn't use perl 4's cgi-lib module. Read: http://www.sitepoint.com/article/uploading-files-cgi-perl Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Regex Unicode Bug?

2004-12-01 Thread Jonathan Paton
: Wide character in print at unicode.pl line 8. 3 = ÅÃ* was smily *Ä* was smily *ÄreÃenu* was smily * So it appears that it works properly for me. Maybe you should try the latest version of perl... Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: Making hash from two arrays

2004-12-01 Thread Jonathan Paton
ticularly "beginner" way to do it though. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Question on subroutines

2004-11-30 Thread Jonathan Paton
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 "$word\n"; } Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

Re: How to install GD for bugzilla

2004-11-30 Thread Jonathan Paton
e day, if you aren't using ActivePerl. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: HTML::Tree help

2004-11-30 Thread Jonathan Paton
} } return \%result; } 1; sub trim { my $string = shift; $string =~ s/\xa0//; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string; } I can provide the HTML it is working on off-list, if you want. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Search Tab-delimited file for Null fields

2004-11-30 Thread Jonathan Paton
ove untested... E&OE] I guess there is plenty of alternative ways to achieve this task. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: tie variable to function?

2004-11-29 Thread Jonathan Paton
ent it all. Benefits? You can adapt algorithms to work with data they weren't intended to work with. Or work with external data that closely matches perl's data types. E.g. DBM files can be represented as a multilevel hash - but I would still prefer to see DBI used instead. Jo

Re: problem with function

2004-11-29 Thread Jonathan Paton
In daten_einlesen() you have: my [EMAIL PROTECTED]; which sets $datenbank to the number of elements in @_ (the arguments to the subroutine). You probably want: my ($datenbank) = @_; Or: my $datenbank = shift; Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Error: Scalar found where operator expected

2004-11-29 Thread Jonathan Paton
Easy. When using strict you must use brackets around subroutine and method calls... I.E. $object->METHOD(args...) You need: my $message=$pop3->RETR($msg_id); Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn

Re: map vs foreach

2004-11-29 Thread Jonathan Paton
"First". Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: map vs foreach

2004-11-28 Thread Jonathan Paton
< $length) { $max_length = $length; } } }, Fifth => sub { my $max_length = 0; my $datum; while (($datum) = each %data) { my $length = length $datum; if ($max_length < $length) { $max_length = $length;