how to update my @INC (can't find .pm's after upgrading perl)

2006-06-04 Thread Harold Castro
Hi, I'm currently running perl-5.8.7, my modules are located in site_perl/5.8.7 however, after upgrading to 5.8.8, all of programs using perl modules, suddenly breaks because it cannot find those modules into its new supposed to be @INC (site_perl/5.8.8.. what can I do with this? Thanks.

printing a range of ip addresses

2006-03-22 Thread Harold Castro
Hi, Can you tell me why this loop doesn't work??? #!/usr/local/bin/perl use warnings; use strict; our $hostpart = 1; our $networkpart = 128; $|=1; while ($networkpart = 158){ while ($hostpart = 256){ print 202.90..$networkpart...$hostpart, \n; ++$hostpart; }

spreadsheets to ldif (trouble looping through array)..

2005-09-15 Thread Harold Castro
Good day! I'm about to transfer our ip allocation table from openoffice spreadsheet into an ldif format. The spreadsheet has 19 columns, some cells are empty though. So far this is what I got: #!/usr/local/bin/perl use warnings; use strict; my $input = shift @ARGV; my $output = shift @ARGV; our

Re: spreadsheets to ldif (trouble looping through array)..

2005-09-15 Thread Harold Castro
Hi John! --- John W. Krahn [EMAIL PROTECTED] wrote: Here is one way to do it: my @array = qw( favorite lessfavorite worstfavorite ); while ( DATA ) { chomp; my @fields = map length() ? $_ : 'NA', split /:/, $_, -1; next unless @fields == @array; my %pairs;

A sript to delete programs installed from source

2005-08-16 Thread Harold Castro
Hi, It seems that whatever software manager an operating system has, still, programs installed manually from their sources are difficult to removed. Do you have a script that will accomlish this job without further hassle? Thanks

Computing elapsed time in this format hh:mm:ss.

2005-05-10 Thread Harold Castro
I need to compute the total elapsed time with this format: start end Total 06:30:17 09:00:14 2.50 hours Do you know any shortcut to this instead of splitting each number in between colons? Discover Yahoo! Get on-the-go sports scores, stock quotes, news

This is weird: Pop works but shift doesn't

2005-04-05 Thread Harold Castro
Hi, I'm parsing a log file that contains this format: 1112677214 31388202 181264589 1112677214 8843 59460 8843 59460 1112676919 10728 59045 10728 59045 1112676900 10617 59006 10728 59045 1112676600 8693 58389 9531 59661 These logs are in unix timestamp format: I'm trying to convert the first

Appending constant string to variable inside a here-document

2005-03-06 Thread Harold Castro
Hi, I'm trying to loop into printing a series of lines so I used here document. Substitution of variables, e.g., $_ works inside the HERE-Document but appending a string won't work For example: if the current content of $word is the word big, and I would want to print a here document appending

Returning to my program after exiting vi.

2005-03-06 Thread Harold Castro
Hi, I wrote a script with a line, system('vi ./config.txt'); which when encountered by the perl compiler, pops up the vi editor and open the config.txt in the current directory. What if I would just want the user the view the very long text file, let's say, a list of something, and his answer

Returning to my program after exiting vi.

2005-03-06 Thread Harold Castro
Hi, I wrote a script with a line, system('vi ./config.txt'); which when encountered by the perl compiler, pops up the vi editor and open the config.txt in the current directory. What if I would just want the user the view the very long text file, let's say, a list of something, and his answer

Text formatting in perl (do I always have to open the txtfile in landscape view?)

2005-03-01 Thread Harold Castro
Hi, I wrote a perl script that will parse a log file and output it into a text file. I made its filename to end in .swx so that it will by default open in openoffice.org. My problem is that, when you open the file, each line cannot accomodate the default margin settings of openoffice.org such

Editing config file entries in between brackets{ } Ex. define host{ hostname value... }

2005-02-21 Thread Harold Castro
Hi, I'm editing a software(nagios)configuration files and I thought it would be much easier if I could just create a perl script to edit such files. Though I have very little ideas coming on how to accomplish this task. I need some tips for this one. The config file format is like this: define

Perl waits for while to finish before printing if on the same line, why?(countdown prog)

2005-02-20 Thread Harold Castro
Hi, I'm new to perl and i'm trying to create a simple program that will act like a time bomb but will print a dot(something like a progress bar every second until the specified time arrives. Here's my code. my $countdown = 5; while ($countdown 0){ print \.; sleep 1; $countdown--; } print

Regex to extract numbers between [ ]

2005-02-17 Thread Harold Castro
Hi, I'm parsing a log file that contains numbers enclosed by []. Ex. [1108702375] I need to extract them so that I can convert them to `date -r` format. Any help is apreciated. __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today!

simple substitution question

2005-02-17 Thread Harold Castro
Hi, There is something that's bothering me for so long regarding the use of $_ variable. for example: here is my string: $_ = but; s/u/a/g; print $_; This will simply print bat My problem is using a variable in place of $_. how will I tell that the one i'm going to substitute is the $string;

Is there a regexp that will match two or more expressions???

2005-02-03 Thread Harold Castro
Hi, I'm looking for a regexp that will match two expressions. Each line of the file I'm reading contains different months and years. I'm only after those lines with particular year and month. All those lines with january and 2005 for example. Any idea? Thanks! here's a portion of the file. Wed

RE: Is there a regexp that will match two or more expressions???

2005-02-03 Thread Harold Castro
; } } print @LinesIWantToKeep; ### -Original Message- From: Harold Castro [mailto:[EMAIL PROTECTED] Sent: Thursday, February 03, 2005 3:55 PM To: beginners@perl.org Subject: Is there a regexp that will match two or more expressions??? Hi

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

2005-01-12 Thread Harold Castro
Good day, This would be quick and simple. I need to write a script that will prompt the user(using STDIN) to enter a series of numbers separated by white space and then push each of those numbers into an array and then do anything such as sorting it from highest to lowest. I've tried doing it

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

2005-01-12 Thread Harold Castro
Good day, This would be quick and simple. I need to write a script that will prompt the user(using STDIN) to enter a series of numbers separated by white space and then push each of those numbers into an array and then do anything such as sorting it from highest to lowest. I've tried doing it

cpaninstall NET::SSH ---- Can't install NET::SSH don't know what it is?

2004-11-07 Thread Harold Castro
Good day! This is the first time I'll be using the cpan to install modules. I run: perl -MCPAN -e shell and answer the questions one by one. When its done, I issued install NET::SSH at the cpan prompt and I got the message: Can't install NET::SSH Don't know what it is. Question: How will I

Client-server with perl?(need some useful progs for squid proxy)

2004-11-04 Thread Harold Castro
Good day! I'm new to perl but not that much of a newbie. In fact I was in the peak of learning perl but then I have to focus my concentration with work when I got my first job. I will be a trainee for 3 months and my first assignment is to administer our squid proxies(4). I line with this,

Re: Client-server with perl?(need some useful progs for squid proxy)

2004-11-04 Thread Harold Castro
Thanks a lot! I will look into this right away. see ya! -- JupiterHost.Net [EMAIL PROTECTED] wrote: Harold Castro wrote: Good day! Hello, I'm new to perl but not that much of a newbie. In fact I was in the peak of learning perl but then I have to focus my concentration