RE: One Question

2006-01-09 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Gomez, Juan [mailto:[EMAIL PROTECTED] Sent: Monday, January 09, 2006 7:48 AM To: beginners@perl.org Subject: One Question Good Morning all!!! Good Morning, Juan, I have working on several shell scripts using KSH but i like to know is there can be a way to

RE: Finding directories within a tree

2005-10-07 Thread Larsen, Errin M HMMA/IT
[EMAIL PROTECTED] wrote: Good Afternoon I am attempting to develop a script that will parse a directory listing and return only directory names that match a given expression. It would make sense to me to use File::Find to do this but based on the dir structure I am parsing, the amount

RE: here tag and internal variable

2005-09-23 Thread Larsen, Errin M HMMA/IT
Frank Geueke, III wrote: Thanks for the help with the reverse if and else. I ended up sigh using a single line forward if on a single line. Now my next question. I'm using a jumbo here tag (I think that's what they're called) to add html to a string. I need to use a variable within the

RE: Compiling perl scripts

2005-08-05 Thread Larsen, Errin M HMMA/IT
Binish A R wrote: Does anyone knows how to compile perl scripts to executables? I'm working on RH Linux and would like to know the details. I know that I can use perlcc to do that ... but it isn't compiling anything other than a simple 'hello world' program :( Is there any other tools

RE: Compiling perl scripts

2005-08-05 Thread Larsen, Errin M HMMA/IT
Larsen, Errin M HMMA/IT wrote: Binish A R wrote: Does anyone knows how to compile perl scripts to executables? I'm working on RH Linux and would like to know the details. I know that I can use perlcc to do that ... but it isn't compiling anything other than a simple 'hello world' program

RE: perl newbie question

2005-07-25 Thread Larsen, Errin M HMMA/Information Technology Department
Edward WIJAYA wrote: On Mon, 25 Jul 2005 21:39:50 +0800, [EMAIL PROTECTED] wrote: Can someone suggest a perl command line snippet that will print the last n lines of a file. If you are under unix/linux just use tail -n command. However if you really want to go via Perl command

RE: perl newbie question

2005-07-25 Thread Larsen, Errin M HMMA/Information Technology Department
Dave Adams wrote: Larsen, Hi Dave. My name is Errin. Larsen is my surname. Please, when posting replies, post to the list. I am afraid I cannot get your suggested code to work. Especially line that reads foreach reverse 0..$n; SNIP On 7/25/05, Larsen, Errin M HMMA/Information

RE: array

2005-07-18 Thread Larsen, Errin M HMMA/Information Technology Department
[EMAIL PROTECTED] wrote: By the way, since you mentioned chomp - what is the difference between chomp and chop? I think they are both for removing some type of un-needed whitespace - does one do space, and the other newline or something? also chomp() the $guess variable to remove the

RE: Pass a value to Perl script

2005-07-13 Thread Larsen, Errin M HMMA/Information Technology Department
Perl wrote: Dhanashri/ Chris Yes!! exactly that is what I am trying to do. I am sorry for not making it clear before. here is the true picture. I have an APP which can run a perl script but just before running the script I have a variable in that app which is holding a value let say

RE: PID of a perl script

2005-07-11 Thread Larsen, Errin M HMMA/Information Technology Department
Mads N. Vestergaard wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey Everybody, Hi there! Just a simple question. How do I get the PID of my running perl script. Check out the doc 'perlvar'. # perldoc perlvar Then, do a search for 'PID'. It's in there. Thanks guys,

RE:Wrapper Script

2005-06-28 Thread Larsen, Errin M HMMA/Information Technology Department
Hi Perl folks, No one replied to my posts about a wrapper script. I'm going to try again. I want to be able to process some command-line options, then call/exec a separate command with my processed options, AND pass along the piped input to that command as well. For example, if I have a

Wrapper Script

2005-06-27 Thread Larsen, Errin M HMMA/IT
(I'm mailing this after posting through Google Groups. I didn't see it get posted, so I'm sending email instead. I hope this doesn't double post. If it does, I'm sorry.) Hi Perl folks, I am trying to write a wrapper script around an executable file so that I am able to better control the

RE: how to append blocks in same file

2005-06-22 Thread Larsen, Errin M HMMA/IT
Aditi Gupta wrote: Hi Perlers, I have a file as follows: #block1 aaa aaa #block2 bbb bbb #block3 ccc ccc and i want to append(or i should say merge) these blocks and get a file like this: aaabbbccc aaabbbccc how can this be done using perl? please help.. regards

Use one option more than once with Getopts

2005-06-17 Thread Larsen, Errin M HMMA/IT
Hi Perl folks, Is there a way to use the Getopts modules to accept more than one instance of a single option? Here is an example command line that I would like to see: # mailfiles -f filename1 -f filename2 [EMAIL PROTECTED] [EMAIL PROTECTED] I'm writing a script to send an email (using

RE: Use one option more than once with Getopts

2005-06-17 Thread Larsen, Errin M HMMA/IT
Larsen, Errin M HMMA/IT wrote: Hi Perl folks, Is there a way to use the Getopts modules to accept more than one instance of a single option? Here is an example command line that I would like to see: # mailfiles -f filename1 -f filename2 [EMAIL PROTECTED] [EMAIL PROTECTED

Top Posting (was RE: host id)

2005-06-10 Thread Larsen, Errin M HMMA/IT
VERY fascinating discussions about the pros and cons of top-posting SNIPPED While I'm sure the arguments for and against the top-posting practices of Internet email lists are wonderful, perhaps we can change the subject of these emails. I keep hoping someone will tell me more about the OP's

Using $# in a splice with split

2005-05-24 Thread Larsen, Errin M HMMA/IT
Hi Perl buddies, Can I do something like this: my $line = 'One Two Three Four Five Six'; my( $first, $last ) = (split(' ', $line))[0,$#(split(' ', $line))]; This does not work. What I want to do is to find the index of the last element of a list created by split, and use it in a slice on

RE: Urgent Help with functions

2005-05-10 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Madhur Kashyap [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 10, 2005 11:34 AM To: beginners@perl.org Subject: Urgent Help with functions Can someone help me out with this simple code? It gives an error saying: Illegal division by zero at test.pl

RE: Fork - Process ID

2005-05-09 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Paul D. Kraus [mailto:[EMAIL PROTECTED] Sent: Monday, May 09, 2005 9:19 AM To: Perl Beginners List Subject: Fork - Process ID Sceniro. I have many cron jobs that run perl scripts. These perl scripts launch TbredBasic Applications. The problem I keep

gcc on Solaris

2005-05-06 Thread Larsen, Errin M HMMA/IT
Hi Perl folks, I want to compile the latest version of Perl on my Solaris 9 server, targeting that same Solaris 9 environment. I have downloaded and installed gcc (because, in it's infinite wisdom, Sun does not ship Solaris with a pre-installed compiler?!) and intend to use it. As a test, I

RE: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-29 Thread Larsen, Errin M HMMA/IT
-Original Message- From: John Doe [mailto:[EMAIL PROTECTED] Sent: Friday, April 29, 2005 8:50 AM To: beginners@perl.org Subject: Re: REGEXP removing - il- - -b-f and - il- - - - f Am Freitag, 29. April 2005 14.43 schrieb [EMAIL PROTECTED]: So which is safer more ideal to use :

Perl one-liner to print columns

2005-04-25 Thread Larsen, Errin M HMMA/IT
Hi Perlers, I typically will type the following to collect a specific column of data from some command's output: # some_command | awk '{print $4}' I wanted to start using perl one-liners more often, so I thought I'd try the column thing first. This is what I came up with: #

Perl One-liner de-compile?

2005-04-25 Thread Larsen, Errin M HMMA/IT
Hi everyone, Here is an example from the perlrun perldoc page: perl -ane 'print pop(@F), \n;' is equivalent to while() { @F = split(' '); print pop(@F), \n; } My question is, can I get Perl to evaluate a command line (like above) and print out the

RE: Perl One-liner de-compile?

2005-04-25 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 1:53 PM To: Larsen, Errin M HMMA/IT Cc: beginners@perl.org Subject: Re: Perl One-liner de-compile? On Mon, Apr 25, 2005 at 01:45:15PM -0500, Larsen, Errin M HMMA/IT wrote: Hi

RE: Perl One-liner de-compile?

2005-04-25 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 2:42 PM To: Larsen, Errin M HMMA/IT Cc: beginners@perl.org Subject: RE: Perl One-liner de-compile? SNIP You're using a lowercase @f here. SNIP Perl will magically

RE: initialize arrays

2005-04-05 Thread Larsen, Errin M HMMA/IT
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 9:24 AM To: Charles K. Clarkson Cc: beginners@perl.org Subject: RE: initialize arrays SNIP [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: : Are these two statements the

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

2005-03-10 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 8:55 AM To: Marcos Rebelo Cc: Perl Beginners Subject: Re: Simplify perl -e '$a = [1,2,3,4,7]; print $a-[EMAIL PROTECTED]' Marcos Rebelo wrote: This is correctly printing '7'

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

2005-03-10 Thread Larsen, Errin M HMMA/IT
SNIP # or, since [EMAIL PROTECTED] will always be the index of the last element of the array: print $a-[-1] Did I get it right? That looks like homework to me ... Why would you ever do that in a practical script? --Errin I think you got it. Ever want the

RE: Defined revisited

2005-03-04 Thread Larsen, Errin M HMMA/IT
Sorry to bother you, since I notice other people have also been asking about defined. But the answers to their questions have not helped me to this point. No problem. That's what we're here for. As long as you've put in the time to try to solve the problem yourself (which it looks

RE: calling an invocation argument from @ARGV

2005-02-25 Thread Larsen, Errin M HMMA/IT
Hi! And, welcome to Perl! I'm trying to automate g++ through a Perl script. Here is what I have written so far: #!/bin/perl -w use strict; ## you should: use warnings; ## it will help you in the future my $counter; $counter = 0; ## With Perl, it's not really

RE: calling an invocation argument from @ARGV

2005-02-25 Thread Larsen, Errin M HMMA/IT
SNIP #!/bin/perl -w use strict; ## you should: use warnings; ## it will help you in the future SNIP Oops! I just realized your using that '-w' switch to perl up there. That IS using the warnings pragma, I believe. Sorry about that! --Errin -- To unsubscribe, e-mail:

RE: Example of hash and array movement correct?

2005-02-18 Thread Larsen, Errin M HMMA/IT
Subject: Example of hash and array movement correct? Hello, Hello I am looking for ways to move data between array and hashes. In all 3 of your examples, you don't show us the declaration of your variables nor how they are filled with data. I can make some

Diamond Operator and Filenames

2005-02-18 Thread Larsen, Errin M HMMA/IT
Hi Perl-Crunchers, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = $logdir/*; push @ARGV, @logs; while( ) { print $filename:\n$_ if( /with errors/ ); } Of course, my problem is that I'm not filling in

RE: Diamond Operator and Filenames

2005-02-18 Thread Larsen, Errin M HMMA/IT
Larsen, Errin M HMMA/IT wrote: Hi Perl-Crunchers, I've got the following code: CODE SNIPPED push @ARGV, @logs; while( ) { print $filename:\n$_ if( /with errors/ ); } Of course, my problem is that I'm not filling in $filename in that print statement

Loops regexps

2005-02-10 Thread Larsen, Errin M HMMA/IT
Hi everyone, I've got a command (if you're familiar with EMC and PowerPath, you'll recognize the output) that outputs a long list of information like this: # powermt display dev=all Pseudo name=emcpower0a Symmetrix ID=000187720658 Logical device ID=00AD state=alive; policy=SymmOpt;

RE: Loops regexps

2005-02-10 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Larsen, Errin M HMMA/IT Sent: Thursday, February 10, 2005 2:37 PM To: beginners@perl.org Subject: Loops regexps Hi everyone, I've got a command (if you're familiar with EMC and PowerPath, you'll recognize the output) that outputs a long list

Variable-sized hash of booleans

2005-02-04 Thread Larsen, Errin M HMMA/IT
Hi everyone, As always, we'll start with some necessary code: #!/usr/bin/perl use warnings; use strict; use Data::Dumper; Let's say I have a hash, but I don't know at compile time how many keys it has in it: my %things; die You have an odd number of

RE: Variable-sized hash of booleans

2005-02-04 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Chris Charley [mailto:[EMAIL PROTECTED] Sent: Friday, February 04, 2005 10:21 AM To: beginners@perl.org Subject: Re: Variable-sized hash of booleans You can use grep. my %hash = (ONE = 1, TWO = 0, THREE = 1); if (grep {! $hash{$_}} keys %hash) {

RE: Variable-sized hash of booleans

2005-02-04 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Chris Charley [mailto:[EMAIL PROTECTED] Sent: Friday, February 04, 2005 10:45 AM To: beginners@perl.org Subject: Re: Variable-sized hash of booleans You can use grep. my %hash = (ONE = 1, TWO = 0, THREE = 1); if (grep {! $hash{$_}} keys %hash) {

RE: Perl module to compare images?

2004-11-24 Thread Larsen, Errin M HMMA/IT
Hi Brian, I don't have an answer to your question. But ... Did you know that O'reilly has a whole book to answer questions like these? Check out: http://www.oreilly.com/catalog/perlgp/ --Errin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent:

RE: How to monitor a scritp

2004-11-23 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Mauro [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 3:44 AM To: [EMAIL PROTECTED] Subject: How to monitor a scritp Hi all, I made a script that works fine. When a try to run it in crontab it seems it doesn't work. It makes an empty output

RE: why $000 is a valid variable name?

2004-11-18 Thread Larsen, Errin M HMMA/IT
Zeng Nan [ZN], on Thursday, November 18, 2004 at 13:43 (+0800) wrote these comments: ZN As said in Learning Perl, a perl identifier is a letter or ZN underscore, and then possibly more letters, or digits, or underscores. ZN Because of this, $123 is an invalid name, but why $000

RE: RE : start http request and move on

2004-11-05 Thread Larsen, Errin M HMMA/IT
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Friday, November 05, 2004 3:08 PM To: [EMAIL PROTECTED] Cc: Jose Nyimi Subject: Re: RE : start http request and move on Nice approach, I have learned today an easy to do it :) Though care should be

RE: Sourcing Configuration files

2004-11-03 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Gavin Henry [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 03, 2004 4:15 AM To: Perl Beginners List Subject: Re: Sourcing Configuration files Chris Devers said: On Tue, 2 Nov 2004, Gavin Henry wrote: What is the easiest way to move variable declarations