Re: Perl Frameworks?

2007-03-07 Thread Randy W. Sims
Tom Smith wrote: I'm curious... With all the buzz about MVC frameworks now, what does Perl have for this? The only two that I'm aware of are Gantry and Catalyst (Catalyst appears to be more complete)--are there others? And which one would be considered the defacto standard (most widely used or

Re: Trouble with variable scoping

2006-08-31 Thread Randy W. Sims
John W. Krahn wrote: Randy W. Sims wrote: Roman Daszczyszak wrote: In my perl script, I have a "global" variable called @excludedIPAddresses, declared at the top of the script using my: [...] When I run this, I get an error "Can't localize lexical variable". I und

Re: Trouble with variable scoping

2006-08-31 Thread Randy W. Sims
Roman Daszczyszak wrote: In my perl script, I have a "global" variable called @excludedIPAddresses, declared at the top of the script using my: [...] When I run this, I get an error "Can't localize lexical variable". I understand that it's because the variable is declared using "my"; what I d

Re: golf

2006-04-19 Thread Randy W. Sims
Chad Perrin wrote: This is kind of a frivolous question, but . . . is there some way to golf this? while (<>) { s/\n/ /; print; } perl -pl40 -e1 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: golf

2006-04-19 Thread Randy W. Sims
Chad Perrin wrote: This is kind of a frivolous question, but . . . is there some way to golf this? while (<>) { s/\n/ /; print; } perl -pl04 -e1 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: how to tell perl to look for where a new module is installed

2006-04-14 Thread Randy W. Sims
chen li wrote: Hi all, Thank you all for reply my post in advance. I install in new module like this: c:/perl/local/new.pm. How should tell the perl to look at it in addition to the default paths? Set the environment variable PERL5LIB to the additional paths. On the command line: `set PERL

Re: regex matching conditionally

2006-04-13 Thread Randy W. Sims
JupiterHost.Net wrote: Howdy list, I'm trying to see if I can do this in one regex instead of multiple stage, mainly for educational purposes since I already have it in multipel steps. I am trygin to get each string between { and } where the {} occurs between double quotes. So with "file

Re: about deleting subroutine

2005-11-21 Thread Randy W. Sims
Jennifer Garner wrote: hi,Randys, Bug #37128: undefing *foo{CODE} does not fully work When I try to access that url,it require me to be verified by username and passwd. So I can't access that url. username: guest passwd: guest Randy. -

Re: about deleting subroutine

2005-11-21 Thread Randy W. Sims
Jennifer Garner wrote: hi,lists, Hi Jennifer, I have seen this thread on perlmonk,and it make me confused too.Can anyone here explain that?Thanks. Quote: --- Basically, deleting subroutines from a symbol table seems a bit buggy, but I don't know if this behavior is documented or not.

Re: Why glob() ?

2005-11-12 Thread Randy W. Sims
Gustav Wiberg wrote: This seems totally meaningless, but what would $list = glob('*.txt') return? Try it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Shortest One-liner to Rename Files

2005-11-12 Thread Randy W. Sims
Wijaya Edward wrote: Hi all, I have a snippet that rename files from: "sth.txt.out" into "sth.out" Now I am really curious how can I make this oneliner "even shorter": $ perl -e ' for(glob ("*.txt.out")){ $out = $_; $out =~ s/\.txt(\.out)/\.out/; rename ($_,$out); }' perl -e '/(.*)\.tx

Re: which perldoc ?

2005-10-19 Thread Randy W. Sims
Jeff 'japhy' Pinyan wrote: On Oct 19, Brian Volk said: Is there a perldoc that will list the available arguments and there meanings for perl-one-liners? Yes. To try and figure out what perldoc to look at for a given topic, do: perldoc perldoc You mean `perldoc perl` ? ;) -- To unsub

Re: Please Help!!! Newbie Question

2005-09-01 Thread Randy W. Sims
Perl wrote: Hi List, I have this script which actually returns the value of the filename with extension but If the file name is something like "c:\projects\text 009.txt" (having a space in filename which is common in windows). This script only returns "text" instead of returning full name of fil

Re: tricky list comparison problem

2005-09-01 Thread Randy W. Sims
Jason Ross wrote: Anyway, the issue I have is that I need to determine where there are gaps between the first sector and last sector (on the entire disk, not on a given partition). So, for example, using the sample data below, I want to return "2097415 - 69078878" as available sectors. Hi J

Re: expanding Ranges

2005-04-24 Thread Randy W. Sims
N. Ganesh Babu wrote: Dear All, input: T 6 TC output T 6 TC How can it be achieved in regular expression?. Or any other means is easy. use Set::IntSpan; my $set = Set::IntSpan->new('1-3,4,5,6-10'); my @elems = $set->elements; print join( ',', @elems ), "\n"; __END__ -- To unsubscribe, e-mail: [EMA

Re: ideintifying whether a module is already installed or not

2005-03-27 Thread Randy W. Sims
Offer Kaye wrote: On Sun, 27 Mar 2005 18:19:22 +0300, Octavian Rasnita wrote: Have you noticed that "-l" parameter? If it is used, the perldoc command just show the directory where the module is installed. Teddy Sigh... did you even try out my example? He most likely did. Your example works fine

Re: ideintifying whether a module is already installed or not

2005-03-27 Thread Randy W. Sims
Edward Wijaya wrote: On Sun, 27 Mar 2005 20:28:42 +0800, Manish Sapariya <[EMAIL PROTECTED]> wrote: Hi list, Hi How do I know whether a given module is installed on machine or not? perl -MModule::Name -e 'print "it is installed\n";' or it's simpler variant perl -MModule::Name -e1 or even perld

Re: regex for l33t speak

2005-03-25 Thread Randy W. Sims
Oops, I forgot to detab before inlining that, and there was some loose ends. Here it is again inlined and attached. It's not optimized in any way, opting instead for a quick straightforward implementation. Incomplete, possibly buggy, completely undocumented. I didn't write it as a patch for Cas

Re: regex for l33t speak

2005-03-25 Thread Randy W. Sims
Andrew Gaffney wrote: Wow, this is more difficult than I first thought. Not really. Just for kicks here is a simple driver: #!/usr/bin/perl use strict; use warnings; use Leetspeak; # $Leetspeak::DEBUG = 1; my $word = shift( @ARGV ); my $l33t = Leetspeak->new(); my $translation = $l33t->translate( $

Re: regex for l33t speak

2005-03-24 Thread Randy W. Sims
Paul Johnson wrote: On Thu, Mar 24, 2005 at 02:25:19AM -0600, Andrew Gaffney wrote: Randy W. Sims wrote: Andrew Gaffney wrote: I'm trying to come up with a regex for my IRC bot that detects 1337 (in order to kick them from the channel). I can't seem to come up with one that will have

Re: regex for l33t speak

2005-03-24 Thread Randy W. Sims
Andrew Gaffney wrote: I'm trying to come up with a regex for my IRC bot that detects 1337 (in order to kick them from the channel). I can't seem to come up with one that will have few false positives but also work most of the time. Has anyone done something like this before? Does anyone have any

Re: Accessing the class

2005-03-20 Thread Randy W. Sims
Offer Kaye wrote: On Sat, 19 Mar 2005 13:37:17 +0200, Octavian Rasnita wrote: And I don't like to use Package::Name directly because I might need to change its name and then I would need to change that name in many places. So place the package name in a variable, and use that variable in all place

Re: Use of uninitialized value

2005-03-17 Thread Randy W. Sims
Wagner, David --- Senior Programmer Analyst --- WGO wrote: Daniel Kasak wrote: Hi all. I'm after people's thoughts on Perl's warnings about 'Use of uninitialized value' in various situations ( string comparisons, subroutine entries, etc ). I understand what the warning is for. In my code, it's perf

Re: Taking Multiple Files in Pairs and Run it Iteratively

2005-03-13 Thread Randy W. Sims
Edward Wijaya wrote: How can I make my code above such that it can take all multiple files iteratively? When possible try to use the data and throw it away as soon as possible to avoid high memory usage. For example, your version reads all of both files in to arrays, then creates another array

Re: Design Plugin System

2005-03-10 Thread Randy W. Sims
Santiago Hirschfeld wrote: Hi everyone, I'm pretty new to perl and i'm doing a program to organize music, I'd like to make a plugin system for the file formats, so i can just use the formats y ussually have, and not include a long list of "use" in my main program. I was thinking in create modules i

Re: uninstalling module

2005-02-11 Thread Randy W. Sims
Martin Mrazek wrote: Hello, I have installed PDL module for perl, but something went wrong and I need to reinstall it. Shall I remove the module first and then install again? How to remove it? It depends on how it was installed. Normally, from the directory of the distribution (./PDL): perl Mak

Re: Input a password from STDIN

2005-02-06 Thread Randy W. Sims
Xiaofang Zhou wrote: > Anyone can help me in this?. When running > > $password = ; > > the password will show on the console windows as user > type in. Is it possible for perl to read from keyboard > directly, without echo to the console window? > perldoc -q password -- To unsubscribe, e-ma

Re: OO subclassing, wrong method being called in hierarchy.

2005-02-02 Thread Randy W. Sims
Michael Kraus wrote: G'day... I've got three classes in a hierarchy, i.e.: Class A (Super class) | Class B (Subclasses A, Superclasses C) | Class C (Subclass) I have a method (called "go") on both B and A. However, if it is called on A die is called as it is designed to be overridden in subc

Re: Checking last character of string for punctuation

2005-02-02 Thread Randy W. Sims
Chris Schults wrote: Thanks to the people who promptly replied. I have two quick follow-up questions: 1) What does "s/\s*$/\./" do? (see email below) It effectively puts a period at the end of the string, while deleting any extra spaces at the end. 2) What are the differences between: $string .=

Re: using namespace

2005-01-27 Thread Randy W. Sims
Ramprasad A Padmanabhan wrote: Is there anyway I can do a using namespace for a particular loop like in c++; ( for functions not exported ) Below are a few dirty little tricks that can get you something similar, but I've never used them, and I'm not sure they are good practice... Use at your own

Re: search.cpan down :(

2005-01-23 Thread Randy W. Sims
Ing. Branislav Gerzo wrote: Harsh Busa [HB], on Sunday, January 23, 2005 at 18:54 (+0530) typed: HB> again i m facing issues with connecting to search.cpan.org from india me too, slovakia. Anyone knows something more, why ? This has been going on for a while, affecting everyone. Not sure what is h

Re: Testing the first line of a file

2005-01-21 Thread Randy W. Sims
David Gilden wrote: Greetings, I was looking for a way to improve the following: # Check to make sure it is an inTune File open (FH, UPLOAD_DIR . "/$file") || error( $q, "Error reading $file for test : $!" ); while(){ if ($_ !~ /\*{5} InTune/){ unlink( UPLOAD_DIR . "/$file") or error( $q,

Re: More elegant solution for a date conversion

2005-01-20 Thread Randy W. Sims
Jason Balicki wrote: Hi, I've got a phone record that keeps the date and time in the following format: YYMMDDHHMM example: 0501201500 So, I've written the following to convert it to the format: MM/DD/,HH:MM example: 01/20/2005,15:00 You can use one of the Date modules that

Re: Using ftp/netrc on AIX

2005-01-20 Thread Randy W. Sims
Jeff Westman wrote: Hi All, I have an ftp script that connects and does the usual things (change dir., site change mode, transfer file, etc). I am using Net::FTP. Currently, I pass the server name, user id and password from the environment. Is $HOME/.netrc compatible with this module, does anyone

Re: regex needed

2005-01-18 Thread Randy W. Sims
Chris Knipe wrote: Lo everyone, Can someone please give me a regex to parse the following... Flags: X - disabled, I - invalid, D - dynamic, J - rejected, C - connect, S - static, r - rip, o - ospf, b - bgp #DST-ADDRESSG GATEWAY DISTANCE INTERFACE 0 S 0.0.0.0/0 r 1

Re: calling Tcl script with ato arguments

2005-01-17 Thread Randy W. Sims
Vladimir Lemberg wrote: Hi All, Could you help me to solve following problem: I need to execute tkl script with two arguments (input file and output file) within my Perl script: #!/usr/bin/perl -w use strict; use File::Basename; my @gdflist = `find . -name *.gdf`; my $gdf_number = scalar(@gdflist)

Re: strict and warnings

2005-01-13 Thread Randy W. Sims
JupiterHost.Net wrote: Chris Devers wrote: On Thu, 13 Jan 2005, Dave Kettmann wrote: [...] Some of the time I see them say that the [strict / warnings] pragmas are good for developing programs/scripts. The way it is worded some times it seems as if after the program is written and in 'producti

Re: strict and warnings

2005-01-13 Thread Randy W. Sims
Dave Kettmann wrote: Hello all, I have seen in quite a few posts to the list from the non-beginners, who I think all of us beginners appreciate them taking their time to help us true beginners, make some references to the strict and warnings pragmas. So I have a question about them. Some of the tim

Re: problem with extracting line

2005-01-13 Thread Randy W. Sims
Anish Kumar K. wrote: Hi I have text file in which I have the below mentioned lines This is a test start-first First Line testing end-first How are you Finally start-second Tested end-second I have a perl file which reads the above file and stores in the variable

Re: Image Creation: labels

2005-01-12 Thread Randy W. Sims
Daniel Kasak wrote: Hi all. I'm hunting for a method of creating labels under Linux. I've already looked at everything on freshmeat.net that came up when I searched for 'labels'. None of them cut it. Requirements: - Coloured, rotated ( 90 degrees ) text rendering - Coloured rectangle rendering Th

Re: installing perl

2005-01-04 Thread Randy W. Sims
Octavian Rasnita wrote: Hi, I have tried to install DBI and I saw that it tells me that perl is installed thread enabled and that this is not recommended for production environments. How can I install perl without beeing thread enabled? I use perl 5.8.4 under Linux Fedora Core 2. If Fedora offers a

Re: Circular References, Self Referenced memory ang Garbage Collection

2005-01-04 Thread Randy W. Sims
Marcos Rebelo wrote: Some time ago I read one article about this Consider that you have: { # make $a point to itself my $a; $a = \$a; } Or { # make $a and $b point to each other my ($a, $b); $a = \$b; $b = \$a; } This memory will be free just at the

Re: $@ not working

2005-01-03 Thread Randy W. Sims
Siegfried Heintze wrote: Does this qualify as a simplified version of the code snippet below? eval{ print "begin\n"; die "throw"; print "done main\n"; }; if(my $err=$@){ print "Exception = $err\n"; } else { print "No exception\n"; } When I single step thru this with the Open Perl IDE debu

Re: A problem about warning information.

2005-01-03 Thread Randy W. Sims
Perl Hacker wrote: Below is my script, When I run the script, everything is ok. #! /usr/bin/perl âw print "111\n"; warn "222 \n"; Problem emerges when using the following command line under csh, $test.pl >& test.log Where test.log is like: 222 111 However, what I experted is: 111 222 Do you guys ha

Re: $@ not working

2005-01-03 Thread Randy W. Sims
Siegfried Heintze wrote: I have the following code (extracted from my cgi program) and I am expecting it to display an error message when it hits the "if ($@){...}" as a result of hitting the "die" statement. It does not (as indicated by single stepping with the windows perl debugger)! Instead it t

Re: Test

2004-12-31 Thread Randy W. Sims
Sandy Santra wrote: Hi, this is just a test. I've been having a lot of problems posting to this list, as I keep getting the following message (even though I'm sending a text message): <[EMAIL PROTECTED]>: ezmlm-reject: fatal: Sorry, I don't accept messages of MIME Content-Type 'text/html' (#5.2.

Re: Patches

2004-12-30 Thread Randy W. Sims
Octavian Rasnita wrote: Hi all, Does anyone know if there are perl modules for applying patches? I have seen on many lists that are provided some patches for some perl modules, and probably they can be applied automaticly under Unix using "patch" for .dif files, but I cannot do this under Windows.

Re: h2xs directory structure in perl-5.8.x?

2004-12-30 Thread Randy W. Sims
Alex Daniloff wrote: Hello Perl people, Recently, upgrading to perl v5.8.5 I've noticed that h2xs lays out module directory structure in a quite different way than before. Prior to this I could create a module e.g. Data::Loader h2xs -XA -n Data::Loader And it would create directory Data, then subdi

Re: Hash problem

2004-12-26 Thread Randy W. Sims
Mike Blezien wrote: Hello, I'm working on settup a hash something like this: my $catid = 'A'; my(%conf); $conf{cat} = { A => ( ["15.00","Three months(90days)","90"], ["30.00","Six months(180 days)","180"], ["4

Re: having problem finding the correct regexp using with split()

2004-12-17 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: Hi all, again i am sending a message to this list hoping you bear with me and my novice question. In my script i would like to split a single scalar containing a random passage of text into a list, which holds the words of the text. What i found in the perl documentation is

Re: perl problems

2004-12-13 Thread Randy W. Sims
Ken Gillett wrote: I've been running RH 8 on my server for some time and regularly ran a fairly complex perl script that parsed an XML file and contained the following line:- last if /^\t{0,2}<$tag>$/; which would exit the loop at the end of that 'section' as $tag in fact contained "/dict".

Re: If you´re in the mood, help me.

2004-12-10 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: Hi guys, As you know, i´m having some problems to make this thing work. I have to write a script that automatically sends a code and get the some information according to that code. I mean, this script has to automatically fill in a formfield and get the result. But I just

Re: confusing warnings and void values

2004-12-09 Thread Randy W. Sims
RichT wrote: Hi all, its time again for me to hassle you, i have my script mostly working, but iv have been bashing my head against a wall trying to fix the last bits... its a script for extracting data from a file and exporting it to another. Problems: 1) i keep getting the warning "Use of uniniti

Re: Printing ?

2004-12-09 Thread Randy W. Sims
Paul Ohashi wrote: Hi All, Is there a way to 'print' to STDOUT and a with one line? Something like:echo "Some text" | tee - a somefile.out -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: problem with strings

2004-12-03 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: Hi Frnds, I have a problem with string passed as an argument to a perl script. I am giving the string \"C:\\PROGRA~1\\INTERN~1\\IEXPLORE.EXE\" as an argument to the cmdtemplate option. and it been taken as C:PROGRA~1INTERN~1IEXPLORE.EXE after parsing it. what happend to

Re: help on structure definition

2004-12-03 Thread Randy W. Sims
Ing. Branislav Gerzo wrote: Hi! I am thinking about best hash structure, I want save all datas from hash to database. Example: Explanation: elements in 'ra' are always 1 times in hash, elements in 'ro' should be zero or more times. Do you think this is good way how to declare hash ? It depends a l

Re: HTML::Tree help

2004-11-30 Thread Randy W. Sims
Ing. Branislav Gerzo wrote: Hi all, I have to parse some thousand of html files, so I'd like to use some html parser, and not my own regexpes. Htmls I am parsing are quite complex, so I need your help. First of all, is HTML::Tree good and fast module? Because, I am not sure if I have to look for so

Re: tie variable to function?

2004-11-29 Thread Randy W. Sims
JupiterHost.Net wrote: Hello list, I saw this recently on here but can't find the thread and since I'm not sure what the technique is called (tie variable to function?) I'm not sure where to look on perldoc :) What is it called/How do you go about doing it when you have a var that each time is

Re: Error: Scalar found where operator expected

2004-11-29 Thread Randy W. Sims
vishwas bhakit wrote: hello, I had used following line in my code to retrieve message where $msg_id shows id of message retrieved by LIST command. code: my $message=$pop3->RETR $msg_id; # Line No. 30 it is showing me following error Error: Scalar found where operator expected at try.pl

Re: sorting with Swartz Transform

2004-11-28 Thread Randy W. Sims
Jeremy Kister wrote: I am trying to simplify some of my code. The output I am expecting is: 1 17.0.0.1 5 27.0.0.1 5 127.0.0.1 5 209.0.0.1 6 10.0.0.1 10 127.0.1.1 where the first colomn is the main sorting column, and if there are multiples of that value, the ip should be sorted. I have code the pe

Re: Blocks in Perl

2004-11-28 Thread Randy W. Sims
Michael Kraus wrote: G'day... I know when say reading a file handle or performing a database update that if the function fails you can use one of the or operators to execute an aleternate statement (either or per say or ||). What happens if you want to execute more than one statement? E.g. $sth->ex

Re: a question about the return value of a subroutine

2004-11-25 Thread Randy W. Sims
Zeng Nan wrote: Hi, Here is a simple program: 1 my @nums = (1..100); 2 my $result = &total(@nums); 3 4 print "$result\n"; 5 6 sub total { 7 my $sum; 8 foreach(@_){ $sum += $_ } 9 $sum; 10 } My question is without line 9, the return value is nothing, while I expect it will return the value

Re: converting the elements of a hash to uppercase

2004-11-13 Thread Randy W. Sims
John W. Krahn wrote: Octavian Rasnita wrote: Hi all, Hello, Please tell me how to convert the elements of a hash to uppercase, if I can access that hash only by reference. For example, I have something like: my $ref = { 'a' => 'aaa', 'b' => 'bbb', 'c' => 'ccc' }; And I want to make 'a' to be 'A'

Re: converting the elements of a hash to uppercase

2004-11-12 Thread Randy W. Sims
Octavian Rasnita wrote: Hi all, Please tell me how to convert the elements of a hash to uppercase, if I can access that hash only by reference. For example, I have something like: my $ref = { 'a' => 'aaa', 'b' => 'bbb', 'c' => 'ccc' }; And I want to make 'a' to be 'A', 'b' to be 'B' and so on, but

Re: using $. line number special variable

2004-11-08 Thread Randy W. Sims
Joseph Paish wrote: how do you use the "line number" variable inside a while loop like i am trying to do below? i never get to process the first line of the file, and as a result, subsequent calculations are inaccurate. it always jumps to the second "if" statement. Like the others, I don't s

Re: TCL

2004-11-08 Thread Randy W. Sims
Chris Devers wrote: On Mon, 8 Nov 2004, Custard, Carol N. wrote: Does anyone know tcl? Yes. I'm sure someone does. What specifically are you wanting to know? And how is it related to Perl? ;-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to get text after comment

2004-11-08 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: Hi, I need to capture whole text after "#" character in each line from a file.The below script is not working can any one suggest the correct thing plz.. Your regexp: if ($line1 =~ /^#\(.*\)/) matches any string that: begins with '#' followed by a literal '(' followed

Parsing strings like the Windows "shell"

2004-11-07 Thread Randy W. Sims
-- Subject: Re: [Module::Build] ANNOUNCE: 0.2601 -> CPAN Date: Sun, 07 Nov 2004 14:17:14 -0500 From: Randy W. Sims <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: Ken Williams <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED], [EMAIL PROTECTED], Perl - Module-Build <[EMAIL PROTE

Re: cpan>install NET::SSH ----> Can't install NET::SSH don't know what it is?

2004-11-07 Thread Randy W. Sims
On 11/7/2004 8:35 AM, Harold Castro wrote: 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: cpan> install Net::SSH case m

Re: how/where to install xyz.pm from CPAN (no perl Makefile.PL; make; make test; make install)??

2004-10-11 Thread Randy W. Sims
On 10/11/2004 11:01 PM, Ken Wolcott wrote: Hi; I see several very interesting CPAN modules regarding Rational/IBM ClearCase. These are just *.pm files. How/where do I install these? I have root privs. I want the modules to be available in the standard place(s). I guess I should just look a

Re: Compiling and distributing Perl

2004-10-07 Thread Randy W. Sims
On 10/7/2004 2:43 PM, Karl Kaufman wrote: Thanks for the reply, Jenda. (OS/arch is Solaris8/Sparc) The difficulty will be knowing exactly which files were added by a module install -- if I want to distribute per module. Otherwise, I guess I can just roll the updated site_perl directory structure.

Re: Upgrading from version 5.8.0 to 5.8.5 on Solaris

2004-10-06 Thread Randy W. Sims
On 10/6/2004 6:21 PM, Eduardo Vázquez Rodríguez wrote: I have the following questions 1. Doing that, how do I use the new perl binary 5.8.5 instead of the old 5.8.0? I believe that /usr/local/bin/perl is pointing to the older version instead of the newer It's just a link to the versioned executab

Re: Regex for logwatch report

2004-10-05 Thread Randy W. Sims
On 10/5/2004 10:36 PM, Randy W. Sims wrote: while (defined( my $line = )) { if ( /-+ pam_unix Begin -+/ .. /-+ pam_unix End -+/ ) { # between beginning and end } } err, that was obviously not tested. Should be: while (defined( my $line = )) { if ( $line =~ /begin/ .. $line

Re: Regex for logwatch report

2004-10-05 Thread Randy W. Sims
On 10/5/2004 10:25 PM, Kevin Old wrote: Hello everyone, I'm parsing a Logwatch report I get daily from my server and have hit a snag. I'd like to grab everything between the "pam_unix Begin" line and the "pam_unix End" line. - pam_unix Begin sshd:

Re: First module

2004-09-14 Thread Randy W. Sims
On 9/14/2004 8:22 PM, Johnstone, Colin wrote: Gidday all, I have written a module to be used with our CMS 'Teamsite' I wonder if any of you Perl gurus can see any holes in this. It has methods to return the following 1) branch path 2) branch name 3) workarea 4) local path any help appreciated thank

Re: Conceptual questions about 'pack'

2004-09-13 Thread Randy W. Sims
Bee wrote: >- besize template 'aAuU', anything else tempplate I can use to >prepare fix length data ? - if yes, but how do I assuming the >block size is? In case, if I write a binary file and I wanna >use seek. You are going to have to explain that in more

Re: sub routine syntax

2004-09-06 Thread Randy W. Sims
Mike Blezien wrote: Hello All, We've been revamping alot of our older perl scripts and a question came up that I wasn't a 100% clear on. When calling sub routines, is there a significate difference in these formats: 1) some_subroutine(); 2) &some_subroutine; This syntax has the special property

Re: Elegant sequencing

2004-08-29 Thread Randy W. Sims
On 8/29/2004 2:36 AM, Bryan Harris wrote: I don't claim to be a master, but you can do something along the lines of: $range = '4.3:8.3'; $range =~ /(\d+).(\d+).(\d+).\2/ and print map "$_.$2 ", $1 .. $3; Since it appears you require that the fractional part be the same for both ends of the range,

Re: utility to install modules

2004-08-26 Thread Randy W. Sims
On 8/26/2004 11:39 PM, Chris Devers wrote: On Thu, 26 Aug 2004, Joe Echavarria wrote: Trying with "/usr/sfw/bin/ncftpget" to get ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY ftp.perl.org: unknown host. ncftpget: cannot open ftp.perl.org: unknown host. Can you ping this host? Can you FTP to it? It s

Re: Regex problems

2004-08-23 Thread Randy W. Sims
me wrote: Hello all, I have been beating my head against the wall for a while trying to extract some data. Here is the following data: My goal is to put all data after each colon into a variable. I don't have any problem with Data 1 through Data 4. My problem is when I get to Data 5:, I can't fig

Re: Sed-type-function

2004-08-23 Thread Randy W. Sims
Dave Kettmann wrote: List, Does perl have any built-in sed-like function? I found ASED.pm, but would rather go with something built in. I looked around a bit, but didnt find anything. I guess I could go with using the Shell module but would rather using as few modules as possible. I'm not sure what

Re: File Modification

2004-08-19 Thread Randy W. Sims
On 8/19/2004 7:40 PM, Subrata k Bose wrote: It is extremely inapropriate to CC questions to so many people who are already members of the mailing list. If you have a question, simply post it to the list. Regards, Randy. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: Problem installing Archive::Tar

2004-08-19 Thread Randy W. Sims
Ronald Nutter wrote: I am trying to install this module for use with a spamassassin server. Using Perl 5.8.3 on Fedora Core 2. Getting the following error when I either try to install the module through CPAN or downloading the tar and doing it the old fashioned way. Would appreciate any suggestio

Re: Trying To write a script

2004-08-09 Thread Randy W. Sims
Singh, Harjit wrote: Randy, The code is still not working with the modifications that you listed earlier. The code does not have any compilation errors but does not show the results for the variables $1, $2 and $3. I was wandering if you could think of something else that is causing the problem.

Re: Trying To write a script

2004-08-09 Thread Randy W. Sims
Singh, Harjit wrote: The following code is what I used to check if item number could be detected for the file I sent in the earlier email. The code seems to have failed and need a advise on it.. A couple of suggestions/corrections: #!C:\perl\bin\perl5.6.1 use strict; use warnings; $file1 = ' C:\pe

Re: iterate over the fields of a struct?

2004-08-07 Thread Randy W. Sims
Christopher J. Bottaro wrote: is there a way to iterate over the fields of a Class::Struct (in the order they were declared)? No. You could store the data used to generate the struct, and then use it later. my @struct_data = [ key1 => 'type', key2 => 'type', ]; struct Name => [EMAIL PROTECTED

Re: Testing whether an array has any elements in it

2004-08-05 Thread Randy W. Sims
On 8/5/2004 11:39 PM, Edward Wijaya wrote: Hi, Is there any efficient way to do that? scalar( @array ) Returns the number of elements in an array. It is a constant time operation; the number of elements is stored as part of the internal data structure, so it's just a lookup. -- To unsubscribe, e

Re: Testing for empty value

2004-08-05 Thread Randy W. Sims
On 8/5/2004 6:23 PM, Jenda Krynicky wrote: From: mike <[EMAIL PROTECTED]> I have the following code print "date times",@date,br; if ($ti1){ print "time 1 is not empty"; } else { print "time 1 is empty"; } If there is a value it works but not if there isn't ie: if there is a value it prints "time 1

Re: Sorting an array of hashes

2004-08-05 Thread Randy W. Sims
On 8/5/2004 5:18 PM, Chris Mortimore wrote: I want to sort an AoH. Not each hash by its keys, but the array by the value of one of the keys in each hash. I know how to sort a simple array. I know how to sort a hash by the keys. Could someone kindly point me to the documentation on sorting arrays o

Re: Number formatting

2004-08-04 Thread Randy W. Sims
On 8/4/2004 10:02 PM, [EMAIL PROTECTED] wrote: Hi all, I am doing conversions from square metres to square feet for example. I have a regex that removes any commas or spaces in a number. I then do the conversion return an integer but then want to display the number with the commas or spaces put bac

Module to merge arbitrary multi-level data structures?

2004-08-03 Thread Randy W. Sims
Does anyone know of a module that can take a reference to two arbitrarily organized data structures, and return a merged structure? Thanks, Randy. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Module to merge arbitrary multi-level data structures?

2004-08-03 Thread Randy W. Sims
Randy W. Sims wrote: Does anyone know of a module that can take a reference to two arbitrarily organized data structures, and return a merged structure? Scratch that. Hash::Merge seems to do what I want. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: howto 'cat file|grep "foo bar"|wc -l' in perl

2004-07-31 Thread Randy W. Sims
Maurice Lucas wrote: Hello, I just started using perl and want to rewrite a simple bash script i've been using in the past to perl. I want to cat file|grep "foo bar"|wc -l and tried it the following way which worked for foobar as one word and not as two words. --- #!/usr/bin/perl $logfile = "/var/l

Re: Perl Core

2004-07-31 Thread Randy W. Sims
On 7/31/2004 12:40 PM, James Edward Gray II wrote: On Jul 31, 2004, at 11:30 AM, Randy W. Sims wrote: On 7/31/2004 12:24 PM, James Edward Gray II wrote: Quick question: What's the best way to find out if a module is standard in the Perl Core and if it is, when it was added? Check out M

Re: Perl Core

2004-07-31 Thread Randy W. Sims
On 7/31/2004 12:24 PM, James Edward Gray II wrote: Quick question: What's the best way to find out if a module is standard in the Perl Core and if it is, when it was added? Check out Module::CoreList -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: sort by extension

2004-07-29 Thread Randy W. Sims
perl.org wrote: On Thu, 29 Jul 2004 12:08:20 -0400 (EDT), Jeff 'japhy' Pinyan wrote That's why he broke it down. Is the map() really the problem, or is it the regex, the ?: operator, and the two array references? All of the above ;), but now that I think about it the map looks easiest, then > ?:

Re: Warnings with Spreadsheet::WriteExcel

2004-07-29 Thread Randy W. Sims
On 7/29/2004 4:27 PM, NandKishore.Sagi wrote: ... a number of messages to a public mailing list with a receipt notification request. Please, don't do that. Features such as receipt notification, message priorities, auto responders are not appropriate for mailing lists. Thank you, Randy. -- To u

Re: Modifying @INC

2004-07-29 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: This is one way of doing it. Probably there could be some other short and sweet ways of doing it. I'm also waiting for such an answer. push( @INC, $path ); require package_name; package_name->import(); # pulls in exported symbols -Original Message- From: PerlDiscus

Re: Keeping track of a variable

2004-07-29 Thread Randy W. Sims
Alok Bhatt wrote: Hi All, Can someone please tell me how do we keep track of a variable. ie Whenever a particular variable is accessed (printed, incremented etc.), a counter should increase, so that we can know how many times it has been accesssed. The mechanism is tie, see `perldoc tie` Here

Re: [SOLUTION] how can i generate 10 unique (non repeating) numbers

2004-07-27 Thread Randy W. Sims
Zeus Odin wrote: If you want to do it without the use of a module, you could (1) add the 15 numbers to an array (the deck) (2) choose a random number from the deck (3) remove that random element and add it to another array (your hand) (4) repeat until done (your hand has 10 numbers) This sounds exa

  1   2   3   4   >