RE: Perl out to PHP

2005-02-04 Thread Thomas Bätzler
Ing. Branislav Gerzo [EMAIL PROTECTED] asked: 2. on my server in uppercase.cgi all text change to uppercase and this result I want send back via _PHP_ to user. Theoretically it should suffice to make sure that your output has the proper MIME type for a PHP document, i.e.

RE: Perl out to PHP

2005-02-04 Thread Thomas Bätzler
Ing. Branislav Gerzo [EMAIL PROTECTED] asked: user come to website, write in textbox some IPs, I want send this input to my perl script (parse that text, takes IPs, do operation with them - insert them to database, check them...), and send results via _PHP_ to user. I have a really nasty

RE: file input/output

2005-02-03 Thread Thomas Bätzler
Elliot Holden [EMAIL PROTECTED] asked: okay this may seem like a simple problem but here it goes: [...] open(OUTFILE, survey.txt); [...] Your web server may not have permission to create the file in question. Always check return codes! open(OUTFILE, survey.txt) or die Could not open file: $!;

RE: Modifying directory permission

2005-02-03 Thread Thomas Bätzler
Anish Kumar K. [EMAIL PROTECTED] asked: Is there any way in perl I can modify the permission of a directory using perl scripts Of course. Check out the builtins chmod and chown. HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: flush function

2005-01-31 Thread Thomas Bätzler
Urs Wagner [EMAIL PROTECTED] asked: I have a problem on WinXP. In perl I want to read the tail of a file. The file is written with another windows program. If I am using a sleep(5) before of the read command I get the new tail content. It seems the program has longer to write it or it is

RE: perl substituion

2005-01-28 Thread Thomas Bätzler
Anish Kumar K. [EMAIL PROTECTED] asked: Say I have a string called returned from the text file.. I don't understand this part. I assume from context that you want to use a template. I could very well use substition for the variables individually. But it will be nice If I could substitute

RE: Trapping Windows Web Activity

2005-01-28 Thread Thomas Bätzler
James W. Thompson, II [EMAIL PROTECTED] asked: Out of curiosity is there any method for trapping Windows HTTP traffic transparently, without establishing a proxy configuration, using Perl. Probably not. Depending on what you want to do, a cheap solution might be to set up a Linux box as a

RE: RegExp equivalencies

2005-01-25 Thread Thomas Bätzler
Michael Kraus [EMAIL PROTECTED] asked: Is: my ($id) = $item =~ /_(\d+)$/; Equivalent to: $item =~ /_(\d+)$/; $id = $1; Yes. It's especially useful when you've got more than one capture in your RE. Wild Technology Pty Ltd , ABN 98 091 470 692 Sales - Ground [...] And that'll really

RE: or die question

2005-01-25 Thread Thomas Bätzler
Hi, After a failed open, I want to run two statements for an or die. Code Quesiton: open (TEST, /tmp/test) or { die Could not open test file\n; syslog(LOG_ALERT,Could not open test file); }; This does not work, but what is the right way

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

2005-01-25 Thread Thomas Bätzler
[EMAIL PROTECTED] suggested: Just as an FYI, you don't need exists in your code at all. It is just a waste of time in your example. Should be beter writen as: print hi if $n{11}; Bad idea, if you consider this: $n{'oops'} = 0; print hi if $n{'oops'}; print ho if exists $n{'oops'}; HTH,

RE: parsing gzipped log files

2005-01-19 Thread Thomas Bätzler
Mariano Cunietti [EMAIL PROTECTED] asked: can anyone address me to a Perl module/function to parse gzipped log files without uncompressing them via gzip/gunzip? You have to uncompress them somehow, but you don't have to uncompress them to a file. I regularly use code like this: if( $file =~

RE: Transforming a space-separated string to an array for words.

2005-01-13 Thread Thomas Bätzler
Robin [EMAIL PROTECTED] suggested: This will split up the string based on the pattern (in this case, a single space. You may want to change that to gain robustness, e.g. /[ \t]+/ will split on any number of spaces and tabs) I suggest /\s+/ instead. This splits on any whitespace, and it'll

RE: Execute a perl array

2005-01-12 Thread Thomas Bätzler
Groleo Marius [EMAIL PROTECTED] asked: i have a simple question : how can i execute an array, knowing that it contains perl code? Assuming you meant a Perl script, not bytecode: eval join(\n,@code); Read all about it with perldoc -f eval. HTH, Thomas -- To unsubscribe, e-mail:

RE: Execute interactive shell scripts from perl?

2005-01-11 Thread Thomas Bätzler
Myers, Drew [EMAIL PROTECTED] asked: I've been lurking on this list for a while, but this is my first email. I've written a series of ksh scripts, that prompts the user for information, and reads the user's input. I'd like to call these ksh scripts from within my perl script. You

RE: GD isn't outputting image data

2005-01-11 Thread Thomas Bätzler
Owen [EMAIL PROTECTED] suggested: Well perhaps for a single debugging line, it doesn't matter too much, but consider a program where endless things can and do go wrong. Peppering your script with or die Can't open the file Data1 $!\n; or die Can't open the file Data2 $!\n; or die Can't

RE: CPAN

2005-01-11 Thread Thomas Bätzler
Daniel [EMAIL PROTECTED] I made a mistake when setting up CPAN, I chose Central America as my Continent, then the only option was to chose Costa Rica as my Country. Not that I have anything against Costa Rica, very lovely place will visit soon, but would like a ftp server closer to my

RE: linked list

2005-01-11 Thread Thomas Bätzler
Christian Stalp [EMAIL PROTECTED] asked: Does anybody has any experience with making liked lists in perl. Perl's arrays are really linked lists - check out the built-in function splice(). HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: Javascript issue

2005-01-11 Thread Thomas Bätzler
Anish Kumar K. [EMAIL PROTECTED] Sorry to put in this PL forum Just don't do it. Say I have Javascript alert like this. BODY onload=window.alert(welcome to my page) when I preview this I get the alert window it is working fine. But The caption of the window is Microsoft Internet

RE: wrong execution of or

2005-01-11 Thread Thomas Bätzler
Mauro [EMAIL PROTECTED] asked: I have a problem with my perl program because I'm not be able to understand why it seems to execute both part of or statement. I'm assuming you're referring to system('/usr/bin/scp -qvp [EMAIL PROTECTED]:/home/clariion/cx700_perf.txt /home/mgatt/rrd/tmp') or

RE: :UserAgent

2005-01-04 Thread Thomas Bätzler
Ing. Branislav Gerzo [EMAIL PROTECTED] asked: just pretty simple question: is LWP::UserAgent encode URL ? for example I have: my $ua = LWP::UserAgent-new; my $resp = $ua-get('http://something.net/this:is+just test'); my question is, if LWP first encode (escape) path in URL as is written

RE: How to monitor a scritp

2004-11-23 Thread Thomas Bätzler
Ing. Branislav Gerzo [EMAIL PROTECTED] wrote: Mauro [M], on Tuesday, November 23, 2004 at 10:44 (+0100) wrote: M I made a script that works fine. M When a try to run it in crontab it seems it doesn't work. it is maybe path related problem. Try tu run exactly that script as in crontab,

RE: Mod_Perl Target Headers

2004-11-05 Thread Thomas Bätzler
James Taylor [EMAIL PROTECTED] asked: Should be a pretty simple question, looking for an option in header_out to target a frame. [...] Was hoping I could do something like: $r-header_out('Target'='_top'); but that doesn't seem to work. Any suggestions? The destination window for a HTML

RE: How do I set POST vars from a perl script

2004-11-05 Thread Thomas Bätzler
A Taylor [EMAIL PROTECTED] asked: I am trying to set some HTTP header variables in a perl script that I can then pick up in another script. I want to create a situation as if some one had POSTed variables from a form. I then want to pick these variables up in an .asp script. You can use

RE: Newbie: Perl Vs Shell

2004-10-29 Thread Thomas Bätzler
Chris Devers [EMAIL PROTECTED] claimed: [...] well written shell scripts don't need Perl and well written Perl scripts don't need external shell commands. I think that's the ivory tower point of view. Down here in the trenches, it's more like a well-written Perl script uses shell commands

Re: Newbie: Perl Vs Shell

2004-10-29 Thread Thomas Bätzler
Chris Devers [EMAIL PROTECTED] wrote: On Fri, 29 Oct 2004, Thomas Bätzler wrote: Chris Devers [EMAIL PROTECTED] claimed: [...] well written shell scripts don't need Perl and well written Perl scripts don't need external shell commands. I think that's the ivory tower point of view. Down here

RE: ftp w/o using Net::FTP

2004-10-28 Thread Thomas Bätzler
James P Donnelly [EMAIL PROTECTED] asked: I am only trying to login into a server, travese to the correct directory, dump a file and quit. I have hacked together something that gets me to the server and then it seems to hang at the login.. Has anyone written something like this w/o

RE: using 'my' problem

2004-10-27 Thread Thomas Bätzler
Murphy, Ged (Bolton) asked: In order to use the array @files in the below code outside of the subroutine, so I need to declare @files globally? I'm getting errors at the moment: Global symbol @files requires explicit package name If so, where is the correct place to declare them in terms

RE: speed up string matching

2004-09-23 Thread Thomas Bätzler
Hi, c r [EMAIL PROTECTED] asked: I need to match an expression and its reverse to a very long string. When a match occurs all matching should stop and the position of the match should be returned. Could you please illustrate this with an example or two? Unless you specify the /g modifier,

RE: how to change values of @INC

2004-09-22 Thread Thomas Bätzler
Bernd Mueller [EMAIL PROTECTED] asked: Would someone be so nice to explain me how i change the values in @INC, because i know where to find this SiteDefs.pm. You could use the use lib pragma, like use lib qw(/path/to/my/modules); HTH, Thomas -- To unsubscribe, e-mail: [EMAIL

RE: cgi script that will auto-submit to another cgi

2004-09-13 Thread Thomas Bätzler
Hi, Johann Tagle [EMAIL PROTECTED] I have a script that receives certain data from an html form, processes them, then submits the processed data to another script. Problem is, I want it to do so without having to click anything anymore. [...] Any ideas? Have a look at LWP and in

RE: Using reference or throw valuables to sub ?

2004-09-08 Thread Thomas Bätzler
Bee [EMAIL PROTECTED] asked: Is that if I throw the array to another sub also means the array would be copied and then pass to the target sub ? while reference is using the same data in system memory? Yes. Use references, unless you need to munge the array in the sub you're calling. HTH,

RE: Splicing Hash problem

2004-09-06 Thread Thomas Bätzler
Edward WIJAYA [EMAIL PROTECTED] asked: How can I take out/splice(?) the element of that hash that start with '1' and store it into another hash. So in the end I will have two hashes: Off the top of my head, I'd say my @temp = grep /^1/, keys %myhash; my %myNEWhash; foreach my $k (@temp){

RE: how to embed c code in perl programs

2004-08-13 Thread Thomas Bätzler
Karthick [EMAIL PROTECTED] asked: Is it possible to embed C/C++ codes into perl programs. (Actually I want to make use of an API, that could be used with with C). It's not exactly simple, but with h2xs you can create a Perl module out of standard C libraries. Well, h2xs creates the module

RE: awk like question

2004-08-13 Thread Thomas Bätzler
[EMAIL PROTECTED] asked: How can I print certain fields delimited by ' '? In awk I would write awk '{print $1, $6}' filename In Perl, that would be perl -lane 'print $F[0] $F[1] $F[5]' filename See the perlrun manpage about all of the command line switches. Here I use -e - run Perl

RE: E-mail Parsing

2004-08-04 Thread Thomas Bätzler
[EMAIL PROTECTED] [EMAIL PROTECTED] asked: I'm have a email in a text file. From this file I would like to get the sender information, the attached files and the body of the e-mail. Is there something simple to do this? Yeah. MIME::Parser from the MIME-tools distribution. HTH, Thomas

RE: swapping in perl

2004-07-23 Thread Thomas Bätzler
Hi, Jaffer Shaik [EMAIL PROTECTED] asked: I want to swap 2 variables without using a tempoarary variable. ( $a, $b ) = ( $b, $a ); HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: __DATA__ Token Question

2004-07-22 Thread Thomas Bätzler
Bastian Angerstein [EMAIL PROTECTED] asked: Could I change the contens of the datatoken (filehandle) during the runtime of the skript? That depends on the OS and implementation - for some you can do that, for others you can't. And the big question is of course if you should do that. HTH,

RE: new window on redirect

2004-07-13 Thread Thomas Bätzler
Tim McGeary [EMAIL PROTECTED] asked: Sort of. What I don't understand is why do you have to decide on the server side, post-request that the result will be in a new window? Couldn't the original portal page just use targets like normal? It's a database driven site and so, unfortunately,

RE: removing duplicate array values

2004-04-21 Thread Thomas Bätzler
Peterson, Darren - Contractor.Westar asked: I'd like to remove duplicate values from an array [...] This is a FAQ. Run perldoc -q duplicate for the answer. HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: Test For Dupplicate elements in an array

2004-04-20 Thread Thomas Bätzler
[EMAIL PROTECTED] asked: I need to test if an array holds duplicates, and if so do something. Try use strict; use warnings; my @array = qw(foo baz bar foo); my %have; foreach my $item (@array){ warn duplicate item $item if exists

RE: Sendmail::Milter

2004-04-19 Thread Thomas Bätzler
Dirk Tamme [EMAIL PROTECTED] asked: I get the error message: /usr/bin/perl: relocation error: /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/auto/Sendmail/Milter/ Milter.so: undefined symbol: smfi_setconn It seems that there is missing something. OTTOH, I'd say your sendmail

RE: AW: book suggestion for atypical beginner

2004-04-08 Thread Thomas Bätzler
Randall wrote: In fact, let me take this one step further. I've been told recently (although I might be misremembering) that O'Reilly will publish NO MORE CDs because of rampant piracy. And the fact that they want to sell Safari subscriptions has nothing to do with it, right? ;-) Thomas --

RE: segmentation fault?

2004-04-05 Thread Thomas Bätzler
Hi, Octavian Rasnita [EMAIL PROTECTED] asked: Does anyone know what could be a reason a perl program gives a segmentation error each time I run it under Linux? This sounds like one of the libraries you're using was built for a different version of Perl or with a different set of libraries. If

RE: Email text encoding

2004-02-11 Thread Thomas Bätzler
Hi, Jan Eden [EMAIL PROTECTED] wrote: and thanks for all the previous suggestions regarding email modules. Now it turned out that my ISP refuses to let me install *any* additional Perl module on the server, so I have to use sendmail. Well, I'm sure he won't let you install a module in the

RE: Perl 6

2004-02-02 Thread Thomas Bätzler
Dan Brow [EMAIL PROTECTED] Any one know when perl 6 will be released for production use? I doubt anybody on this list will be able to give you anything else but when it's done as the answer. Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: using crontab

2004-01-13 Thread Thomas Bätzler
Octavian Rasnita [EMAIL PROTECTED] asked: Does anyone know what line I neet to print after using the crontab -e command, in order to run a program every half an hour, at 0 minutes and at 30 minutes? You need to print out the crontab manpage and read it. If you don't have them on your

RE: -e with single quotes

2003-12-11 Thread Thomas Bätzler
Dan Muey [EMAIL PROTECTED] asked: I'm tryign to do a perl -e '' command and am wondering if it is possible to do single quotes inside the single quotes. perl -e print \joe's mama\n\; perl -e 'print joe.chr(39).s mama;' HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Problem with 'cc' command in CPAN makes (i.e., Bundle::CPAN)

2003-12-11 Thread Thomas Bätzler
Hi, glidden, matthew [EMAIL PROTECTED] asked: I'm using the CPAN module to build my modules and have hung up just trying install Bundle::CPAN. Installing Data::Dumper, for example, shows a 'cc: command not found' error during make. My system uses gcc instead of cc, but I'm not sure where to

RE: Get file size without downloading

2003-12-10 Thread Thomas Bätzler
Hello, usef [EMAIL PROTECTED] asked: Is there any way to get the size of a file without downloading it? I want to write a program using LWP to download a file only if it is bigger than 3K but smaller than 500K. So I need to know the file size in the first place. Try making a HEAD request -

RE: javascript error

2003-12-09 Thread Thomas Bätzler
mark o' sullivan [EMAIL PROTECTED] asked: I'm trying to include javascript code in my perl script but I'm getting the following error 'Can't find string terminator quot;EOFquot; anywhere before EOF at calendar.pl Anyone have any ideas why I might be getting this error. Usually that's

RE: Perl and MS Access

2003-12-04 Thread Thomas Bätzler
Hello Shaunn, I think I've seen it, but I don't know where - Isn't there a method to use Perl to connect to some MS Access database and extract the data into some other format (say, text). That works fine with the DBD::ODBC module. If you have got large records in the database, you should

RE: Perl Form Mail

2003-12-01 Thread Thomas Bätzler
Hello Stephen, Does anyone have any recommendations for a perl cgi script that will accept input from a HTML form and verify that the form input isn't going to do something nasty? At present the CGI we are using is based on form-mail.pl which is apparently notorious for security holes.

RE: reading from address bar

2003-12-01 Thread Thomas Bätzler
Hello Mark, Any ideas is it possible to read the address bar through perl alone? Assuming that you meant a web browser's address bar running on a client you don't control, no. And that's not even considering that there are clients without address bars ;-) But why would you want to do that,

RE: When is Perl 6 coming out?

2003-11-13 Thread Thomas Bätzler
km [EMAIL PROTECTED] asked: i am just curious -- is perl 6 coming with a compiler ? That depends on your definition of compiler. It certainly has a compiler that creates byte code, just as all of the current Perl versions. I don't know wether it will have a compiler like PerlEx bundled. What

RE: invoking external programs

2003-11-13 Thread Thomas Bätzler
Hi, [EMAIL PROTECTED] [EMAIL PROTECTED] asked: I'm actually building a web interface to a news group server (INN). One of the feature is to allow a few users to create and delete newsgroups from the web. Hopefully only for your local news hierarchy ;-) Normally, from the shell, I would

RE: use CGI qw(:cgi-lib :standard);

2003-11-12 Thread Thomas Bätzler
Yehezkiel B Syamsuhadi [EMAIL PROTECTED] asked: What does this line mean? use CGI qw(:cgi-lib :standard); The qw operator makes a text into a list by splitting at the whitespace. That list is passed to the module as an argument. In CGI.pm's case these arguments are used to specify what

RE: Starting Perl

2003-11-11 Thread Thomas Bätzler
yomna el-tawil [mailto:[EMAIL PROTECTED] asked: i'd like to say first that i'm using activePerl , under windows. If you've installed that properly, you're set. for O'Reilly, i couldn't subscribe or even have the 14 days trial because i don't have a credit card.. :( I have a question,

RE: Finding the current path

2003-10-27 Thread Thomas Bätzler
Octavian Rasnita [mailto:[EMAIL PROTECTED] wrote: Thank you, but $0 will tell me the path and the file name of the script.pl file, not the path from where I ran the script. So the FindBin module is not what you need? Now, I could run pwd and get what I want, but in fact I need to run this

RE: how do I pass null arguement?

2003-10-10 Thread Thomas Bätzler
Hi, [EMAIL PROTECTED] wrote: How do I pass a null variable as an argument? Sometime I may want a wrapper sub as below: Example, ... sub procName { my $fname = $_[0]; my $lname = $_[1]]; } Alternatively, you could write either my $fname = shift; my $lname = shift; or even my(

RE: regex, is this possible?

2003-10-08 Thread Thomas Bätzler
Jerry Preston [EMAIL PROTECTED] asked: I am trying to break down the following: printf(numsteps=%d i=%d im=%g vfr=%g \n,numsteps,i,imeas,vforce); into numsteps= numsteps i=i im=imeas vfr=vforce \n printf (\noriginal cap = %g, offset = %g, *ci, cap_offset); into

RE: Add text to beginning every line

2003-10-07 Thread Thomas Bätzler
Hi, Chris Charley [EMAIL PROTECTED] wrote: Should be (works correctly): while () { s/^/Line: $. /; print; } Then the command could be:perl prepend.pl somefile.txt somefile.new which would correctly print to the 'new' file the somefile.txt file with the line

RE: another how to regex ?

2003-10-07 Thread Thomas Bätzler
Hi, Jerry Preston [EMAIL PROTECTED] asked: I am trying to change some text from: if ( (fabs(log(im[ii]/im[ii-1])/vstep) fabs(3*log(im[ii-1]/im[ii-5])/(4*vstep)) ) ((im[ii] ifr[x]) || (im[ii-1] ifr[x])) ) { to if ( (fabs(log(im[ii]/im[ii-1])/vstep) fabs(3 *

RE: explicit vs implicit syntax

2003-10-02 Thread Thomas Bätzler
[EMAIL PROTECTED] asked: Here's an excerpt about the from orielly and what the heck does it means: ...If a subroutine is called using the form, the argument list is optional. if ommitted, no @_ array is setup for the routine; the @_ array at the time of the call is visible to subroutine

RE: easiest `cat` in perl

2003-10-02 Thread Thomas Bätzler
Todd Wade [EMAIL PROTECTED] wrote: Gary Stainburn [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [...] One thing you forgot was to close the file. Also, don't forget that you can do it with less typing: Closing files is optional in Perl ;-) Filehandles will either be closed

RE: easiest `cat` in perl

2003-10-02 Thread Thomas Bätzler
Joshua Colson [mailto:[EMAIL PROTECTED] suggested: sub load_file { my($file,$html) = shift; $html = ''; open(FILE, $file) or die Cannot open $file for reading: $! while(FILE) { $html .= $_; } return $html; } Instead of while(FILE) { $html .= $_; }, you could use $html = join(,

RE: index

2003-10-01 Thread Thomas Bätzler
Ronen Kfir mailto:[EMAIL PROTECTED] asked: The following script meant to calculate simple math drills, such as 5 * 9 or 4 + 3, written in one line. What I cannot comprehend is the lines marked with ---. What do they do? Why is there a 0 index... That looks like somebody wrote a C program

RE: To quotes or not quotes parameter

2003-09-29 Thread Thomas Bätzler
[EMAIL PROTECTED] [EMAIL PROTECTED] asked: what is the proper way to pass a parameter for something like $cgi-param(username)? as far as i know it, this works for me: $cgi-param(username); Don't do that. Using barewords as strings can break your code if you later on introduce a sub with

RE: Order of Command Line Options

2003-09-26 Thread Thomas Bätzler
Hi, Jeff Westman [mailto:[EMAIL PROTECTED] asked: Why does the order of these options matter? [...] $ nslookup someServer | perl -en 'print qq($_);' $ nslookup someServer | perl -ne 'print qq($_);' -e must be followed by the code: $ perl --help Usage: perl [switches] [--] [programfile]

RE: Getting started in Perl for Windows

2003-09-25 Thread Thomas Bätzler
Dillon, John [mailto:[EMAIL PROTECTED] asked: When I am in a black command.com screen with CPAN prompt, where am I? Why can't I cd to c:\? That would be the CPAN prompt. Try help for a terse command listing, quit to exit back to the DOS prompt. CPAN is the Perl module installer. Check out

RE: Getting started in Perl for Windows

2003-09-25 Thread Thomas Bätzler
Dillon, John [mailto:[EMAIL PROTECTED] asked: Is there a gobble-di-gook looker-upper for perl. For instance, if I don't know what '@_' is saying, as in: my($email, $orig_email) = @_; Look at the perlvar manpage. @_ is the array that has the parameters passed to a function. The above line

RE: regex. help

2003-09-24 Thread Thomas Bätzler
Hi, Pandey Rajeev-A19514 [mailto:[EMAIL PROTECTED] asked: I have a question regarding matching strings that have embeded perl special characters. $abc = 'MC10.G(12)3c'; $efg = 'MC10.G(12)3c'; Now I want to check whether they are same or not by doing if ($abc =~ /$efg/) { do something;}

RE: One Time Only Code in Sub

2003-09-24 Thread Thomas Bätzler
Hi, James Edward Gray II [mailto:[EMAIL PROTECTED] asked: I would like to add some code to a sub that only needs to be run the first time the sub executes, or before is fine. If I add an INIT { } block at the beginning of the sub, would that do it? Are there other ways? Thanks. If you

RE: list-parsing problem

2003-09-19 Thread Thomas Bätzler
Marcus Claesson [mailto:[EMAIL PROTECTED] asked: I have a silly little list-parsing problem that I can't get my head around, and I'm sure some of you have come across it before. Sure. Looks like homework ;-) HTH, Thomas #!/usr/bin/perl -w use strict; my %unique; while( DATA ){ my( $key,

<    1   2   3   4