Re: udp server

2009-12-01 Thread Telemachus
On Tue Dec 01 2009 @ 1:09, Rene Schickbauer wrote: Take a look at link removed I highly recommend that you buy the Perl Cookbook, most of these problems (or rather the solutions for them) for these kind of tasks are in there ;-) I agree that the Perl Cookbook is an excellent resource.

Re: Is it necessary to open the file again to read its contents.

2009-11-17 Thread Telemachus
On Tue Nov 17 2009 @ 11:23, Parag Kalra wrote: Now if want to again the loop through the contents of the file I was not able to do the following again: while ( FILE ) { print $_\n; } Instead I had to first close the previous file handler and the again open the file to loop through

Re: can I wipe cpan off my computer?

2009-11-07 Thread Telemachus
On Sat Nov 07 2009 @ 8:27, Shawn H Corey wrote: The cpan program is little more than a shell for CPAN.pm. When you first start cpan, it says to install Bundle::CPAN and a newer version of CPAN.pm. These modules do not play nice. Last time I installed them, I could get cpan to work at all.

Re: Learning Perl Student Workbook

2009-11-02 Thread Telemachus
On Mon Nov 02 2009 @ 9:33, Parag Kalra wrote: Hey Folks, This thread was about book - 'Learning Perl Student Workbook' and not the book - 'Learning Perl' So is there a way we can buy genuine/official/legal ebook version of 'Learning Perl Student Workbook' from somewhere. If yes then

Re: Learning Perl Student Workbook

2009-11-02 Thread Telemachus
On Mon Nov 02 2009 @ 7:14, tom smith wrote: use strict; use warnings; $\ = \n; my @book_types = ('hard cover book', 'soft cover book', 'ebook'); if ('soft cover book' eq 'ebook') { print 'yes'; } else { print 'no'; } --output:-- no Right. The original post in this

Re: Learning Perl Student Workbook

2009-11-01 Thread Telemachus
On Sun Nov 01 2009 @ 10:51, raphael() wrote: Hi, I just finished reading 'Learning Perl' I was wondering if someone could point me to the book Perl Study Guide, also called Learning Perl Student Workbook. It's a companion book to Learning Perl but is not available in my country. I

Re: Learning Perl Student Workbook

2009-11-01 Thread Telemachus
On Sun Nov 01 2009 @ 12:32, Parag Kalra wrote: google doesn't turn up any soft copies ?? Is any electronic copy of this book even there? Even I am not sure if there is any soft copy available or not...Lets wait till we get input from other members of the mailing list... Cheers, Parag I'm

Re: adding populations

2009-10-06 Thread Telemachus
On Tue Oct 06 2009 @ 11:24, Jesus Fernandez wrote: Dear friends, I'm working in a genetic drift simulation and I want to add a second population to my script, any suggestions how to do that? Is this a follow-up to a previous question? Either way, please keep in mind that we don't have any

Re: Change character code 160 to 32

2009-10-05 Thread Telemachus
On Sun Oct 04 2009 @ 3:28, Shawn H Corey wrote: If you're on Linux, type: man ascii Works on OSX, too. And thanks for the tip. That's handy, and I never knew it was there. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org

Re: great new installation package - how to override /usr/lib/perl5/site_perl/5.8.8?

2009-10-05 Thread Telemachus
On Mon Oct 05 2009 @ 8:46, Charles Smith wrote: I'm trying to install UR-v0.12 - and encountered a great wizard. But I don't have root access on my machine. I get You are not allowed to write to the directory '/usr/lib/perl5/site_perl/5.8.8' even though I'd entered Your

Re: best way to get number of elements in list value

2009-09-22 Thread Telemachus
On Tue Sep 22 2009 @ 10:56, Chas. Owens wrote: On Tue, Sep 22, 2009 at 09:40, Bryan R Harris bryan_r_har...@raytheon.com wrote: Can you explain how perl interprets this?  I would've incorrectly thought: 1)  () = func_that_return_list_value tries to assign the list to () which perl would

Re: Tell your lawyers [Was - Re: Out Of Memory]

2009-09-20 Thread Telemachus
On Sun Sep 20 2009 @ 9:01, Shawn H Corey wrote: Ajay Kumar wrote: __ This communication contains information which is confidential. It is for the exclusive use of the intended recipient(s). If you are not the intended

Re: Tell your lawyers [Was - Re: Out Of Memory]

2009-09-20 Thread Telemachus
On Sun Sep 20 2009 @ 10:13, Shawn H Corey wrote: Telemachus wrote: Ok, I'll bite: do you really mean to say that it's a crime somewhere to put this bullshit drivel into an email and then send that mail to a public list? Annoying, sure. Pointless, sure. Non-binding, sure. But a crime

Re: Tell your lawyers [Was - Re: Out Of Memory]

2009-09-20 Thread Telemachus
On Sun Sep 20 2009 @ 12:17, Shawn H Corey wrote: Rodrick Brown wrote: These disclaimers are requirements for anyone working in the securities industry. There isn't much the poster can do about this and shouldn't be bashed for this. Many of these disclaimers are automatically appended to

Re: Ternary operator

2009-09-11 Thread Telemachus
On Fri Sep 11 2009 @ 4:16, Chas. Owens wrote: I love perldoc, but it does not document the language nearly as well as Programming Perl. Of course, that might be why perldoc is free and Programming Perl costs roughly $50 USD (and weighs a ton). There's also the problem that Programming Perl

Re: accessing chars in a string

2009-09-02 Thread Telemachus
On Tue Sep 01 2009 @ 10:44, Steve Bertrand wrote: A good place to reference regex is [1]. [1]: http://perldoc.perl.org/perlretut.html I will throw in my two cents and mention that if you are starting regular expressions, you may find perldoc perlrequick a little more gentle, as an

Re: Perl6

2009-09-01 Thread Telemachus
I've been following Perl6 via these links. You may find some good reading at one or another of these: http://szabgab.com/perl6_tricks_and_treats.html http://perlgeek.de/blog-en/perl-5-to-6/ http://perlgeek.de/blog-en/perl-6/ You can also find some interesting projects on Github that are using

Re: source code for builtin functions

2009-08-27 Thread Telemachus
On Thu Aug 27 2009 @ 4:55, Shawn H. Corey wrote: Nowadays, Linux comes with Perl but not its documentation. To download it, start your favourite package manager and download the package perl-doc Also, since some of it refers to the Syscalls, you may want its documentation. Its package is

Re: source code for builtin functions

2009-08-27 Thread Telemachus
On Thu Aug 27 2009 @ 2:40, heyi xiao wrote: I knew perl is written in C, but I am still interested in checking the C source for some builtin function directly. Is there any good way to go? If you browse to this site, you can download the source code for whatever version of Perl you're

Re: Totally lost on how to get the argv of Perl

2009-08-24 Thread Telemachus
On Sun Aug 23 2009 @ 9:06, Andrew Steinborn wrote: Shawn H. Corey wrote: Andrew Steinborn wrote: I need to know how to get the arguments passed to Perl. I'm using the ActiveState built version of Perl on Windows Vista. Perl loads the command-line arguments into the special variable @ARGV

Re: one liner in Windows to replace string

2009-08-24 Thread Telemachus
On Mon Aug 24 2009 @ 4:45, Tony Esposito wrote: perl -p -i.bak -e 's/CONSTANT/VARIABLE/' C:\test.txt Trying to replace a string with this one line perl ... in Windows it does not seem to work ... File test.txt contents is ... CONSTANT 100 CONSTANT 200 nothing changes ... acts as

Re: one liner in Windows to replace string

2009-08-24 Thread Telemachus
On Mon Aug 24 2009 @ 8:08, Tony Esposito wrote: Looks good but it bombs ... the Perl interpreter crashes from the DOS prompt ... using version 5.10.0 build 1005 from ActiveState. But it was better than what I had, that's for sure This makes for a bit of a mind teaser thanks to it being

Re: Business::UPS should be fixed or removed.

2009-08-23 Thread Telemachus
On Sat Aug 22 2009 @ 10:30, Rick Bragg wrote: Hi, As far as I can tell, this perl module returns bogus numbers that have nothing to do with the real prices from UPS and should be done away with or fixed. If you use this, beware, check out your prices, will all be low. Rick Thanks for

A side note [was Re: Attentipn Please!! Need A Perl script to yada yada]

2009-08-18 Thread Telemachus
On Mon Aug 17 2009 @ 4:09, Uri Guttman wrote: I == Ian pcs...@gmail.com writes: I Unfortunately I'm not an expert. I just read a few books and this list etc. a couple of things. it is good that you are offering to help but as you claim not to be an expert, it can hurt more than

Re: script to compare dates

2009-08-18 Thread Telemachus
On Tue Aug 18 2009 @ 7:55, Mihir Kamdar wrote: I dont have Datetime module installed. Is there a way without using DateTime?? I don't want to be glib, but I can see at least two broad possible options: (1) Install DateTime (it's very worth it). (2) Rewrite all the relevant code from DateTime

Re: IO::File close on undef behaviour?

2009-08-12 Thread Telemachus
On Wed Aug 12 2009 @ 11:27, Philip Potter wrote: If $fh goes out of scope, will the file be automatically closed? Yup. From perldoc perlopentut: Another convenient behavior is that an indirect filehandle automatically closes when it goes out of scope or when you undefine it:

Re: 'Join' query

2009-08-07 Thread Telemachus
On Fri Aug 07 2009 @ 4:03, jet speed wrote: Hi, I would like to join the $abc with ':' the final desired output 1:2:3:4:5 #!/usr/bin/perl use strict; use warnings; my $abc = 1 2 3 4 5; my $out = join ':', $abc; print $out; The function join works on lists not scalars. This would

Re: ||= operator

2009-08-07 Thread Telemachus
On Fri Aug 07 2009 @ 2:55, Admin wrote: Hi there, is there a page that explains the ||= operator and similar operators? google is not quite finding the special characters in the first 10 hits. Google and punctuation don't mix well, apparently. In any case, try perldoc perlop in a terminal

Re: two questions

2009-08-06 Thread Telemachus
On Thu Aug 06 2009 @ 2:29, sys adm wrote: I do hate to write s/^\s+|\s+$//g for each and each time,just got tired of it. So I hope perl can have that a string operator, since many script languages have that, and it's used universally. Write the subroutine once, and then you won't have to do

Re: Convert Array's into hashes

2009-08-06 Thread Telemachus
On Thu Aug 06 2009 @ 11:19, jet speed wrote: @array1 = ( D_101 D_102 D_103 D_104); @array2 = (0 1 2 3); How can i convert both of these arrays into %hash, assigining the @array1 as keys and @array2 as values. use warnings; use strict; my @array1 = qw/D_101 D_102 D_103 D_104/;

Re: bug in perl

2009-07-17 Thread Telemachus
On Fri Jul 17 2009 @ 3:18, Octavian Rasnita wrote: From: Shawn H. Corey shawnhco...@gmail.com Octavian Rasnita wrote: Well, in PHP that calculation is made well, so I think there is a bug in perl. No, it's not. PHP rounds off the number before printing. In Perl: printf %.2f, $x; or

Re: Understanding recursion

2009-07-10 Thread Telemachus
On Fri Jul 10 2009 @ 9:26, Dermot wrote: The algorithm works perfectly but my understanding of it's workings is amiss. When I look at this I see $E initialised and then concatenate with the the modulus of 37 % 2 =1 18 % 2 = 0 9 % 2 = 1 4 % 2 = 0 2 % 2 = 0 That by my reckoning is

Re: File::Find with chmod trouble debugging

2009-07-06 Thread Telemachus
On Mon Jul 06 2009 @ 7:00, Harry Putnam wrote: Can anyone tell me how printing of $mode = 0755 turns into 493? Yup: what's in $mode is an octal number. Its decimal equivalent is 493. What you really want to print out is the string '0755', but the string and the octal number are not the same

Re: File::Find with chmod trouble debugging

2009-07-06 Thread Telemachus
On Mon Jul 06 2009 @ 3:31, Harry Putnam wrote: Thanks to all ... Now I'm curious about something else: Is the mode in a stat(file) readout something still different than octal or decimal? As John answered, there's more there than just the permissions. If you check perldoc -f stat, there's

Re: Getting started

2009-06-24 Thread Telemachus
On Wed Jun 24 2009 @ 2:16, Daryl Styrk wrote: I've purchased Learning Perl to finally give picking up perl a fair shot. However in the beginning of the book it suggest that I should have an understanding of basic programming concepts such as variables, loops, subroutines, and arrays... Well,

Re: ref() or ! ref()

2009-06-23 Thread Telemachus
On Mon Jun 22 2009 @ 11:10, Steve Bertrand wrote: I've got a relatively decent understanding of how references work in Perl (syntax-wise, especially when/how to de-ref), but I'd now like to ask when to use them. Obviously memory allocation isn't an issue anymore, so when exactly should refs

Re: Replace System(Dir) call Help

2009-06-21 Thread Telemachus
On Sun Jun 21 2009 @ 7:40, AndrewMcHorney wrote: Hello I have written a perl script and I am in the debugging and imroving the code. The first improvement is want to make is to replace the system(Dir c:/s) call because it is not portable. So I was told to use the File package. I think

Re: file handle in perl

2009-06-17 Thread Telemachus
On Wed Jun 17 2009 @ 3:42, Ajay Kumar wrote: Hi Irfan You can do all four task like below 1: open FILE ,filename.txt or die$!; 2: my @lines=FILE 3: do changes through sed Like sed -e 's/original pattern/new pattern/p' filename 4:if you did changes it automatically get saved 5:

Re: List of perl functions that work on LINUX not in Windows

2009-05-29 Thread Telemachus
On Fri May 29 2009 @ 10:00, sanket vaidya wrote: Kindly provide a list of perl functions that work on LINUX but not on windows. Also provide the list of functions that behave differently on Windows LINUX. This not project requirement. I just want to explore the functions on LINUX. So far I

Re: readdir() question

2009-05-25 Thread Telemachus
the wrong file.' Consider this: use strict; use warnings; opendir(my $dh, '/home/telemachus/practice') || die can't opendir: $!; my @contents = readdir($dh); my @files = grep { -f /home/telemachus/practice/$_ } @contents; my @noprepend = grep { -f $_ } @contents; print

Re: prob w/anonymous array

2009-05-20 Thread Telemachus
On Wed May 20 2009 @ 1:50, pa...@compugenic.com wrote: I have the following data structure defined: my @clients = ( { name= 'joe', count = [ qw( one two three ) ] } ); Then I try running the following routine: for my $client (@clients) { for my $i

Re: Push to AoA

2009-05-14 Thread Telemachus
On Wed May 13 2009 @ 9:22, Steve Bertrand wrote: Jim Gibson wrote: The first argument of push should be an array, not a scalar (even if that scalar is a reference to an array). push( @{$graph_data-[0]}, $x_axis ); I'll have to do a bit of reading, because I can't remember why the

Re: Programming Perl vs perldoc

2009-04-08 Thread Telemachus
On Wed Apr 08 2009 @ 1:08, Richard Hobson wrote: But, what's the advantage of Programming Perl when we have perldoc? What does the book give me that perldoc does not? One thing that nobody has mentioned is that Programming Perl hasn't been updated since Perl 5.6. There have been two major

Re: Programming Perl vs perldoc

2009-04-08 Thread Telemachus
One other thing: http://perldoc.perl.org/ is an excellent way to read the docs online (searchable too), and it provides pdf versions of almost everything. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: LWP

2009-04-08 Thread Telemachus
On Wed Apr 08 2009 @ 3:22, ANJAN PURKAYASTHA wrote: I have a file stored at a location: http://parent_dir/file Which among gazillion LWP options can I use to download and store the file on my machine? TIA Anjan If you just want to grab the file, you can use LWP::Simple to grab it: use

Re: LWP

2009-04-08 Thread Telemachus
On Wed Apr 08 2009 @ 10:29, Gunnar Hjalmarsson wrote: Telemachus wrote: On Wed Apr 08 2009 @ 3:22, ANJAN PURKAYASTHA wrote: I have a file stored at a location: http://parent_dir/file Which among gazillion LWP options can I use to download and store the file on my machine? If you just

Re: perl script to check whether software is installed

2009-04-06 Thread Telemachus
On Mon Apr 06 2009 @ 2:44, Irfan Sayed wrote: please adivce / help Regards Irfan Please don't reply to your own mail as a way of nudging people to reply. It's more likely to annoy than to get you an answer. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands,

Re: Pattern matching question

2009-03-31 Thread Telemachus
On Tue Mar 31 2009 @ 3:32, Richard Hobson wrote: It works, but is there a way of combining these lines: my $piece = $ref-[$_]; $piece =~ /.*(..$)/; It feels like this could be done in one step. Is this correct? I'm finding that I'm doing

Re: Printing directory sizes

2009-03-31 Thread Telemachus
On Tue Mar 31 2009 @ 11:08, Octavian Râşniţă wrote: Do you know if du has a parameter that lets us see the size of the files from chosen directories? I've seen that it shows the disk usage only. From man du: -a, --all write counts for all files, not just directories

Re: quick regex question

2009-03-25 Thread Telemachus
On Wed Mar 25 2009 @ 12:19, Rodrick Brown wrote: On Wed, Mar 25, 2009 at 12:00 PM, Rick Bragg li...@gmnet.net wrote: I need a quick regex to strip out the following: example: change remove-all-this (Keep This) into just Keep This $s =~ s/.*\((.*)\)/$1/; something like: s/

Re: quick regex question

2009-03-25 Thread Telemachus
On Wed Mar 25 2009 @ 3:10, Chas. Owens wrote: On Wed, Mar 25, 2009 at 13:21, Telemachus telemac...@arpinum.org wrote: snip    my $string2 = 'remove-all-this (Keep this) remove this too';    $string2 =~ s/.*\((.*)\)/$1/; snip If $string2 may contain more than one pair of parentheses

Re: Help needed in understanding some lines of code.

2009-03-19 Thread Telemachus
On Thu Mar 19 2009 @ 10:41, Chas. Owens wrote: On Thu, Mar 19, 2009 at 06:11, Raheel Hassan raheel.has...@gmail.com wrote: Can anybody explains this piece of code, i have difficulties in understanding it, snip - long, careful, generous explanation of ugly, ugly code removed You're much nicer

Re: Parsing file line by line.

2009-03-10 Thread Telemachus
On Tue Mar 10 2009 @ 4:13, Meghanand Acharekar wrote: Hi, Need some help How can I parse a file line by line using perl. I want to parse a test file having following data format *File : user_stats.txt* 20GB Larry 14.5MB Bob 3MBJohn so that I can send this data to a

Re: Printing directory sizes

2009-03-03 Thread Telemachus
On Tue Mar 03 2009 @ 10:21, Lauri Nikkinen wrote: Ok, thanks. Now I notice that I did not understand correctly what this script does. I was trying to print sizes of all directories in the directory tree. But anyway, I appreciate your kind help! The line find( sub { #code here}, $dir ) simply

Re: Printing directory sizes

2009-03-03 Thread Telemachus
On Tue Mar 03 2009 @ 4:03, Telemachus wrote: find( sub { -f and ( $size += -s _ ) }, $dir ); That line tests if each item in $dir is a *file* (-f). Sorry: hit send too quickly. What I meant to say there is that the subroutine tests for files - starting from whatever directory you specify

Re: word similarity measure

2009-03-02 Thread Telemachus
On Fri Feb 27 2009 @ 8:24, Susan wrote: If my data looks like this: word 1: 100101 101102102 102106106 word 2: 101104 106110113 129131148 word 3: 101153 175180381 word 4: 106110 113122131 137142

Re: Accepting default value for user input

2009-03-02 Thread Telemachus
On Mon Mar 02 2009 @ 7:54, Sarsamkar, Paryushan wrote: Ohh ... sorry ... after rethinking over it ... I think it converts the $normal to lower case before comparison Right, which is a standard and smart thing to do since you can't count on your users to correctly type 'y-e-s'. Damn users.

Re: Is there function to separate print associative array

2009-03-01 Thread Telemachus
On Sun Mar 01 2009 @ 1:04, Octavian Râsnita wrote: From: prasath_linux prasath@gmail.com Hi, Is there any possible function to print the associative array. We have print_r() function in PHP to display the associative array. Likwise is there any function in perl to print associative

Re: flattening @AoA

2009-02-23 Thread Telemachus
On Mon Feb 23 2009 @ 6:27, r...@goto10.org wrote: problem with below @linearray prints - but just prints an array of array references (i think thats what it is anyway!) i tried to flatten it to @array but i dont really know what i am doing. i need to have all the data in @linearray

Re: Bundle-Expect

2009-02-20 Thread Telemachus
On Fri Feb 20 2009 @ 3:02, ramesh.marimu...@wipro.com wrote: Thanks Thomas. Actually when is give use Expect;, the error I get is Can't locate Expect.pm in @INC Is there anything that I'm missing or should I check something? -ramesh As a start, you can run this command to see what

Re: Reading 2 array lists

2009-02-20 Thread Telemachus
On Fri Feb 20 2009 @ 10:28, Dermot wrote: 2009/2/19 mritorto mrito...@gmail.com: guys more questions isn't built in. I am using active state perl can u recommend any good perl books the ones I have aren't make for beginers like perl cookbook or perl in a nutshell I'd say

Re: Reading 2 array lists

2009-02-20 Thread Telemachus
On Fri Feb 20 2009 @ 1:29, mrito...@gmail.com wrote: I have that one I need one for perl dummies like me If you want an alternative, take a look at Beginning Perl by Simon Cozens: http://www.perl.org/books/beginning-perl/ It's written for Perl 5.6 (I think), but the core of the syntax

Re: perl deprecated functions and alike

2009-02-15 Thread Telemachus
On Sun Feb 15 2009 @ 9:45, Octavian Râsnita wrote: From: John W. Krahn jwkr...@shaw.ca Kevin wrote: Could someone please direct me to some web pages where I can go through all deprecated perl functions and/or ways of writing perl script? It is not easy for me to figure out whether an

Re: Add Line break when first of a line changes

2009-02-15 Thread Telemachus
', enter the name of the file you want to work on. The two files should be in the same directory for this to work. Otherwise, you will need to enter the full path of the file, perl new_liner /path/to/filename You should get output like this: telemachus ~ $ perl new_liner feed LAWN

Re: Add Line break when first of a line changes

2009-02-15 Thread Telemachus
On Sun Feb 15 2009 @ 8:56, Jack Butchie wrote: I did some fiddling with the list. I noticed if the second or third or whatever column wasn't exactly the same as the previous, even though the tex in the first field was the same, line was being added. I then tested with only the first

Re: Add Line break when first of a line changes

2009-02-15 Thread Telemachus
On Sun Feb 15 2009 @ 9:48, Jack Butchie wrote: I used a tab, then a pipe, both produced the same results. LAWNS|123|GOOD LAWNS|12|GOOD The results are the same because the test is for the whole line. If you only want to test one field, you need a different script. For example, this will

Re: How to speed up two arrays compare.

2009-02-11 Thread Telemachus
On Wed Feb 11 2009 @ 4:04, kevin liu wrote: Hi everybody: I have two arrays(@nwarray0 and @nwarray1) in my program and i want to make sure that all the elements in @nwarray0 could be found in @nwarray1. Check 'perldoc -q array' - two or three of the FAQ answers touch on different

Re: ending a character to each line

2009-02-05 Thread Telemachus
On Thu Feb 05 2009 @ 11:17, stuforman wrote: i want to use perl to end each line with a '~'. i would really appreciate any syntax that would help me do this... thanks in advance Here's one quick version. This will work and ignore lines without any text or spaces: perl -ple '$_ = $_~

Re: local perl documantaion

2009-02-04 Thread Telemachus
On Wed Feb 04 2009 @ 5:49, Dermot wrote: Hi, I have until recently used a widows box and Activestate's perl. I now use a *nix box. Something I am missing a lot is the html documentation tree that Activestate builds when it's installed and keeps up to date with it ppm. Is there a way to

Re: perlscript

2009-01-30 Thread Telemachus
On Fri Jan 30 2009 @ 5:34, Octavian Rasnita wrote: Hello, Does anyone have some recommendations for some tutorials/documentation for using perlscript as a client-side language in browsers? Thank you. Octavian Never knew that there was such an animal. A quick Google search offers this:

Re: Updating Perl 5.8.8 to 5.10 under MacOSX and Eclipse EPIC

2009-01-19 Thread Telemachus
On Sun Jan 18 2009 @ 6:31, Steven Sankaran wrote: Hm. I have spent the last hour or so attempting to get this to work, but I cannot seem to get Perl to update. I have located the 5.10 directory under /usr/local/ActiveState-5.10 but I cannot get Eclipse to recognize it. I even tried Eclipse

Re: Using / of unix and \ of windows for copying files

2009-01-19 Thread Telemachus
On Mon Jan 19 2009 @ 2:13, Sarsamkar, Paryushan wrote: Hi All, snip How can I work with / and \ here? My suggestion would be to use File::Spec rather than hardcode the \ or / as a path separator. See perldoc File::Spec for more information, but in a nutshell, it's a core module built to

Re: Newbie question about variables, arrays and where they all go

2009-01-19 Thread Telemachus
On Mon Jan 19 2009 @ 4:21, dolphin_sonar wrote: Again, you answered my question. You should be teaching Perl as your responses are very clear and that's not easy for people to do...give clear, concise responses. Actually, I had a big goof in my response. The program and the print statement

Re: Newbie question about variables, arrays and where they all go

2009-01-18 Thread Telemachus
(say as running_sum( 2, 7 );) If I add that call, here's my output: telemachus ~ $ perl sum The sum of (5 6) is 11 The sum of (5 6 2 7) is 31 That appears to say that perl has added 5, 6, 2, and 7 up to 31. What actually happened was that you added 5, 6, 2 and 7 (20) to 11 (the sum from

Re: Updating Perl 5.8.8 to 5.10 under MacOSX and Eclipse EPIC

2009-01-18 Thread Telemachus
On Sun Jan 18 2009 @ 4:35, Steven Sankaran wrote: Hello, So, I was going through a tutorial and I realized that my Eclipse install is using an older version of Perl that does not recognize the say command. I have attempted updating Perl to 5.10 using the ActivePerl-5.10.pkg ,however, as far

Re: Newbie question about variables, arrays and where they all go

2009-01-18 Thread Telemachus
From: Telemachus telemac...@arpinum.org Date: Sun, 18 Jan 2009 20:17:27 -0500 To: beginners@perl.org Subject: Re: Newbie question about variables, arrays and where they all go On Sun Jan 18 2009 @ 7:54, Telemachus wrote: The arguments to a subroutine go into the @_ array. The @numbers array

Re: Perl Newbie question about upgrade from Perl 5.8.8 to 5.10

2009-01-15 Thread Telemachus
On Wed Jan 14 2009 @ 8:17, dolphin_sonar wrote: Hi, I bought the O'Reilly 5th edition Learning Perl the other day and it's great. I am new to programming and Perl as well. I do know my way around Linux but I am having problems upgrading from the version that was on my OS (Cent OS 5.2) to

Re: need help on perl script

2009-01-15 Thread Telemachus
On Thu Jan 15 2009 @ 1:12, Kammen van, Marco, Springer SBM NL wrote: Looking at all his posts below with the exact same format just different questions... Is this guy for real... or is this a spam bot?? A real guy with a lot of homework? -- To unsubscribe, e-mail:

Re: Passing info to a sub function

2009-01-13 Thread Telemachus
On Mon Jan 12 2009 @ 7:56, Mr. Shawn H. Corey wrote: On Mon, 2009-01-12 at 18:40 -0600, Harry Putnam wrote: I'm in the middle of some administrative type of scripting and my skill level is pretty low. I ran up on a need to pass two different kinds of chunks of into to a sub function. snip

Re: Neater way to declare variables

2009-01-08 Thread Telemachus
On Thu Jan 08 2009 @ 11:56, Taylor, Andrew (ASPIRE) wrote: # In a number of places, I have code that looks like the following. my $default_type; if( $split_line[0] eq DEFAULT_INPUT ) { $default_type = INPUT; } snip This works OK, but I'm trying to avoid

Was re: inverting List::Compare

2009-01-04 Thread Telemachus
On Sat Jan 03 2009 @ 11:00, John W. Krahn wrote: David Newman wrote: I always found it cleaner, and have heard others say it's preferable, to declare all variables at the top of the program (although admittedly I didn't do that even in this short script). It is always better to limit the

Re: inverting List::Compare

2009-01-03 Thread Telemachus
On Sat Jan 03 2009 @ 9:21, David Newman wrote: On 1/2/09 5:22 PM, Rob Dixon wrote: #!/usr/bin/perl -w use strict; You should also use the warnings pragma instead of the command-line switch. use warnings; OK. Why is this better? My understanding is that the pragma (use

Re: how to use module when not installed by web-hosting company

2008-12-08 Thread Telemachus
On Mon Dec 08 2008 @ 7:17, itshardtogetone wrote: Hi, My website is hosted in 110mb.com and they do not have this module installed Algorithm::Numerical::Shuffle qw /shuffle/; So what can I do to use that module. Thanks You should be able to create a directory in your $HOME, say

Re: Good Resource (book) for RegEx

2008-12-03 Thread Telemachus
On Wed Dec 03 2008 @ 10:46, Rex wrote: In order to ramp up quickly on the nitty-gritty of Regular Expressions in Perl, what will be a good book to start with? I do have moderate familiarity with RegEx, but am still not using all that Perl's RegEx engine has to offer. Hence the question.

Re: How to make two perl work together?

2008-12-01 Thread Telemachus
On Mon Dec 01 2008 @ 12:04, Chas. Owens wrote: On Mon, Dec 1, 2008 at 08:23, Jeff Pang [EMAIL PROTECTED] wrote: Message du 01/12/08 11:38 De : howa A : beginners@perl.org Copie à : Objet : How to make two perl work together? Hello, I have one perl (5.10) installed by my

Re: help with subroutines and reading/writing to file

2008-12-01 Thread Telemachus
On Mon Dec 01 2008 @ 7:13, blake askew wrote: Thanks for the help John. I have made the changes you suggested and managed to get everything working properly. One more question though that is completely different, how do I allow users to specify switches on the command line in any order to be

Re: random

2008-11-25 Thread Telemachus
On Tue Nov 25 2008 @ 9:29, Sharan Basappa wrote: Hi, Would like to know if perl has native (without using special modules) for generating random numbers? Shawn already pointed you in the right direction, but here's a good tip. If you want to check if you something Perl-ish, try 'perldoc -q

Re: random

2008-11-25 Thread Telemachus
On Tue Nov 25 2008 @ 12:45, Telemachus wrote: If you want to check if you something Perl-ish Something clearly went wrong here. I got caught between to check if you can do something with Perl and to check something Perl-ish. What I sent was neither. Feh. -- To unsubscribe, e-mail: [EMAIL

Re: perl version for windows

2008-11-25 Thread Telemachus
On Tue Nov 25 2008 @ 3:27, Chas. Owens wrote: On Tue, Nov 25, 2008 at 12:26, Rob Dixon [EMAIL PROTECTED] wrote: Chas. Owens wrote: I need to look up why they call apartments flats. 'Flat' came from old english 'flet', and that from old german 'flaz' and 'flezzi' meaning 'flat',

Two questions about split and map in a cookbook recipe

2008-11-17 Thread Telemachus
reference?!?) Sorry if this is very long. I wanted to make sure to include enough information to make the questions clear. Thanks in advance, Telemachus -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Two questions about split and map in a cookbook recipe

2008-11-17 Thread Telemachus
On Mon Nov 17 2008 @ 10:21, John W. Krahn wrote: Set paragraph mode. while () { Read a paragraph into $_. In your example a paragraph is: field:value field:value field:value my @fields = split /^([^:]+):\s*/m; Since there are multiple lines in a paragraph they use

Re: Using perl in a Bash-script to extract IP-addresses?

2008-11-09 Thread Telemachus
On Sun Nov 09 2008 @ 1:31, JC Janos wrote: I've read that Perl (which I don't know yet at all) is best for Text processing like this. The thing is that I need to do this from within a Bash script, and assign the comma-separated list to a variable in that Bash script. Can I even use Perl

Re: Cron environment for execution of Perl script

2008-11-08 Thread Telemachus
On Thu Nov 06 2008 @ 3:42, Wagner, David --- Senior Programmer Analyst --- WGO wrote: I need an environment variable from my .profile on Solaris and having troubles getting at it. I have a Perl script which executes fine outside of cron and now am trying to do via cron. I wanted to

Re: debugger exiting

2008-11-04 Thread Telemachus
On Tue Nov 04 2008 @ 4:11, Rob Dixon wrote: Rob Dixon wrote: If I had things my way there would never be any use of Perl as a command-line tool. Isn't this throwing out the baby with the bathwater? Here's a random, real, recent example of why I'm not giving up Perl on the command line. I

Re: Curly braces and the logic of PERL

2008-10-28 Thread Telemachus
On Mon Oct 27 2008 @ 12:35, John W. Krahn wrote: The fewer lines of code to read and/or write, the easier it is to spot mistakes, the less chance for action at a distance. I find that there's a point, however, where compression and understanding cross paths. After that, the fewer lines and

Re: Curly braces and the logic of PERL

2008-10-27 Thread Telemachus
On Mon Oct 27 2008 @ 5:05, Brian wrote: An example of something confusing me is in the sample below find sub { return unless -f; open my $FH, '', $_ or die Cannot open '$_' $!; while ( $FH ) { /\Q$string/ print $REPORT $File::Find::name\n and return;

Re: ignore directories with File::Find?

2008-10-23 Thread Telemachus
On Wed Oct 22 2008 @ 4:32, protoplasm wrote: I ran find2perl to give me some output that I included below (in Sub_directory). If I have no network shares mounted it runs fine. But I have some shares mounted (sftp, or smb, etc.) via Nautilus, the below script really takes a long time. It

Re: variable in perl

2008-10-15 Thread Telemachus
On Tue Oct 14 2008 @ 3:58, Rob Dixon wrote: Chas. Owens wrote: [...] if for some reason you don't have access to perldoc Are there any installations of perl that don't include the manual? In Debian (and so probably many of its children), perl-doc is a distinct package and not installed

Re: how to change string to scalar

2008-07-06 Thread Telemachus Odysseos
On Sun Jul 06 2008 @ 5:58, loody wrote: BTW, do you know where I can find the whole list after substitution and pattern matching, m/,? Check out these three parts of the documentation: perldoc perlrequick perldoc perlretut perldoc perlre That goes in increasing order of complexity, detail,

Re: how to read the last line of a file directly?

2008-07-06 Thread Telemachus Odysseos
On Sun Jul 06 2008 @ 8:09, loody wrote: Dear all: I try to read the last line of a file directly instead of using while() or something else to read each line until undef bumped to me. If you know some build-in functions or another modules for me to use, please help me. My first thought is

  1   2   >