-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
[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
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
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
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
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
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
[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
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
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,
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
(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
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
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
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
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
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
-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
-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
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
-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 :
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:
#
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
-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
-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
-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
-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'
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
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
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
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:
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
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
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
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;
-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
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
-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) {
-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) {
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:
-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
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
-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
-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
44 matches
Mail list logo