Since Perl doesn't use the registry or absolute paths to find its
modules that should work just fine. The only thing to watch out for is
that you will be violating the ActiveState license if you distribute
your own ActivePerl distribution outside of your organization without
getting their okay
If you want to pass a filehandle like that I would recommend using the
FileHandle module.
As your script stands, however, you have no reason to pass the
filehandle to the subroutine. You can just do a print ERRLOG $scalar
to print.
-Original Message-
From: Ted Fines [mailto:[EMAIL
One more thing: If you're not already doing so, you should probably
start putting
use strict;
use warnings;
at the top of your scripts. It will be a pain in the short term but
will help you out later on.
-Original Message-
From: Stephan Gross [mailto:[EMAIL PROTECTED]
Sent:
This is true, however I believe Spreadsheet::ParseExcel still works
under Linux.
-Original Message-
From: Toddy Prawiraharjo [mailto:[EMAIL PROTECTED]
Sent: Monday, August 28, 2006 4:05 PM
To: beginners@perl.org
Subject: How do i open excel files under linux
Is it possible to open
$everything is a scalar reference to an array. You can dereference the
array with the '@$everything' notation or the '@{$everything}' notation.
(The second one removes any ambiguity about the reference, but 99% of
the time the first way is okay.)
You can access elements of the array by either
Comments below.
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Sent: Friday, August 25, 2006 6:25 PM
To: Perl Beginners
Subject: Re: Using a regular expression to remove all except
certaincharacters.
Dr.Ruud wrote:
snip
You might actually be looking for this:
Didn't see this one before I hit 'Send'.
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Sent: Friday, August 25, 2006 6:28 PM
To: Perl Beginners
Subject: Re: Using a regular expression to remove all except
certaincharacters.
John W. Krahn wrote:
snip
Or remove
Yes, it is possible, but it would be ill-advised. I think what you are
really looking for is an array of arrays.
Check out 'perldoc perllol' (list of lists) for a description of how to
do this. It's a good technique to learn anyway, since it opens the
doors to more complex data structures.
I believe you want 'perldoc -f splice'.
-f is for internal functions.
-Original Message-
From: chen li [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 16, 2006 9:31 AM
To: beginners@perl.org
Subject: line command in perl
Dear all,
I want to find the usage of a specific function
Check out the File::Find. You can use it to recursively find and copy
all of the files.
If you want to manipulate the files based on pathname or filename, also
check out File::Basename. Both should already be on your computer.
-Original Message-
From: Steve Jardine [mailto:[EMAIL
-Original Message-
From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
Sent: Monday, August 14, 2006 4:48 PM
To: beginners@perl.org
Subject: Re: math module and array manipulation
chen li wrote:
Dear all,
I have an array contains 12 numbers. I want to
calculate the mean and standard
I have no idea what dbmopen is, but I would seriously recommend
scrapping all of that and just going with DBI and DBD::ODBC (the DBI
driver that allows you to work with ODBC data sources). Here's a small
example of how you can work with DBI to get data from a database using a
DSN you set up on
Have you taken a look at the DBI documentation?
my $sth = $dbh-prepare('SELECT * FROM Table');
$sth-execute();
while(my $row = $sth-fetchrow_hashref()){
my $name = $row-{NAME};
}
-Original Message-
From: Mike Blezien [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 09, 2006 9:09
Check out the documentation on the eval function
perldoc -f eval
-Original Message-
From: Ryan Perry [mailto:[EMAIL PROTECTED]
Sent: Monday, August 07, 2006 1:12 AM
To: Perl Beginners
Subject: string to perl
I have a string I want to pass to another function and I want that
If you're using Windows then ActivePerl integrates all of the perldocs into its
HTML documentation.
Start--Programs--ActivePerl--Documentation.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 03, 2006 10:28 AM
To: beginners@perl.org
Subject:
Your best bet here might be to use the %ERRORLEVEL% variable in your
batch script and then print it to the screen with an easily identifiable
tag (E.g. 'ERRORLEVEL=x'). Your perl script can just look for your
status messages and pull them out with a regex:
my $result;
foreach my $output(
For learning the basics I actually recommend Perl From the Ground Up.
You can buy a used copy for cheap on Amazon. It doesn't deliver what it
says on the cover, but it does a good job of explaining basic concepts
for people who don't have any experience in programming. Once you're
ready to
Use \E to stop the quoting.
-Original Message-
From: Jeremy Kister [mailto:[EMAIL PROTECTED]
Sent: Friday, July 28, 2006 1:01 PM
To: beginners@perl.org
Subject: regex quoting
perldoc -q quote talks about \Q before a regex to escape special
characters.
how do you use \Q when you want
Try backticks instead of the system() call to capture the outputh.
E.g. my @results = `$cmd`;
-Original Message-
From: Sayed, Irfan (Irfan) [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 27, 2006 7:48 AM
To: beginners@perl.org
Subject: File opeartions help
Hi,
I am executing
Check out 'perldoc -f do'.
Also, get a new laptop. :)
-Original Message-
From: Martin Tournoij [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 26, 2006 10:05 AM
To: beginners@perl.org
Subject: Splitting a script into multiple files
snip
My laptop, on which I do all my
Try backticks instead of the system() call.
my @results = `stat $inputScratch`;
-Original Message-
From: Ryan Moszynski [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 26, 2006 11:46 AM
To: beginners@perl.org
Subject: saving system output as $
is there a way to save the output of a
If you really just want everything that doesn't match, do it like this:
if($string !~ /pattern/){
do something...
}
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, July 21, 2006 5:52 PM
To: beginners@perl.org
Subject: using 'negative
-Original Message-
From: tom arnall [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 20, 2006 12:08 PM
To: beginners@perl.org
Subject: Re: how to add a list of numbers
snip
Whatever happened to good old:
my (@data,$result);
@number = (1,2,3);
$sum = 0;
I think it might be clearer if you checked this doc:
perldoc lib
Which has a good explanation of using 'use lib' to define directories to
search for modules.
-Original Message-
From: Shourya Sengupta [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 20, 2006 12:07 PM
To: Joshua Colson
-Original Message-
From: Dr.Ruud [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 20, 2006 4:18 PM
To: beginners@perl.org
Subject: Re: array help
my @test = (/test , /playground);
print @test;
snip
i need the output in following fasion
/test
/playground
can you please tell me
It works for me, but it sounds like '[A-Z][a-z]+' might not be doing
what you think.
That says One upper-case letter followed by one or more lower-case
letters. I can see one problem with that right now. I live in Santa
Clara, which won't match because it has a space in it. But this
matched:
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Tom Phoenix
Sent: Saturday, July 15, 2006 3:22 PM
To: Ralph H. Stoos Jr.
Cc: beginners perl
Subject: Re: Help with Stupid question
On 7/15/06, Ralph H. Stoos Jr. [EMAIL PROTECTED] wrote:
I want to know if
\1 is the same thing as $1 inside of a regex, but it is generally
recommended that you don't use it.
From 'perldoc perlre':
Warning on \1 vs $1
Some people get too used to writing things like:
$pattern =~ s/(\W)/\\\1/g;
This is grandfathered for the RHS of a substitute to
Run 'perldoc perlop' at the command-line.
Check out the section about the Conditional Operator for the first
question, and the second question will be under Quote and Quote-like
Operators, in the m/PATTERN/cgimosx section.
-Original Message-
From: Ryan Moszynski [mailto:[EMAIL
Here's one way to do it:
#
if($file =~ /^NQSname.+\.txt$/){
rename ($file,'NQSname.txt');
}
#
-Original Message-
From: Nishi Bhonsle [mailto:[EMAIL PROTECTED]
Sent: Friday, July 14, 2006 5:29 PM
To: beginners perl
Subject: strip
Hi:
I have a filenames such as
This isn't a Perl problem, it has to do with how your shell is
processing the command-line parameters.
Put double-quotes around the directory name and you won't have a
problem.
-Original Message-
From: Nishi Bhonsle [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 13, 2006 11:44 AM
To:
Just to clarify: the double-quotes should go around the argument on the
command-line, not the variable in Perl.
-Original Message-
From: Timothy Johnson
Sent: Thursday, July 13, 2006 11:47 AM
To: Nishi Bhonsle; beginners perl
Subject: RE: How to ignore spaces in directory names?
Put
Probably the simplest way to do this would be to use the File::Copy
module. It's about as straightforward as you can get.
move($BNY_DOWNLOAD.\\.$filename,$BNY_DATA.\\.$filename) or
die(Couldn't copy $filename to $BNY_DATA! $!\n);
-Original Message-
From: kilaru rajeev [mailto:[EMAIL
In addition to the suggestions that have already been given about
associating the .pl file extension with perl.exe, I would heartily
recommend that you install ActivePerl from http://www.activestate.com.
It's free, and is the de facto standard for Windows Perl. There are
other ones that work
It looks like part of your message got munged by one of our mail
clients, but here's a code snippet that should give you an idea of how
you can proceed:
##
use strict;
use warnings;
$| = 1;
my $string = '200607081000@@01510';
#Check to make sure the regex matched, then proceed.
Why not just use split()? Then you can do a simple regex on each
element:
###
use strict;
use warnings;
my $string = '1-10;25;33;1-00-250';
my @array = split(/;/,$string);
foreach my $element(@array){
if($element =~ /^\d+-?\d*?$/){
print $element = valid\n;
At the moment I can't think of why this makes a difference (somebody
help me here), but you aren't specifying a mode for the open() function.
Also, you're not checking whether your match succeeded before using $1
(which is what I think you meant on that last line).
I personally would write it a
-Original Message-
From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED]
Sent: Monday, July 10, 2006 5:02 AM
To: beginners@perl.org
Subject: Re: backslash on windows
snip
myscript.pl -cfg D:\users\config.txt
inside the script, when capturing the config file mentioned above,
the
\ is
Are you testing on IE?
There is an Win32::IEAutomation module that should be able to handle
what you want if IE is the browser you want to test.
-Original Message-
From: Suja Emmanuel [mailto:[EMAIL PROTECTED]
Sent: Sunday, July 09, 2006 10:16 PM
To: beginners@perl.org
Subject: How
The documentation seems to indicate that the -M is the number of days
older than the script start time the file modification time is. I think
what you want would be something like:
If( (stat $path)[9] time - 1200 ){
Do something...
}
Which will get the 10th (starts from 0) element of
Are you sure that the user the jsp is running under has permissions to
the module directory?
-Original Message-
From: Ray Gebbie [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 06, 2006 12:45 PM
To: beginners@perl.org
Subject: Errors with dynamic extensions loading when running from jsp
You'd be better off making a second hash:
my %reverse_char;
while(my($key,$value) = each %char){
$reverse_char{$value} = $key;
}
print $reverse_char{a};
-Original Message-
From: Beginner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 05, 2006 8:48 AM
To: beginners@perl.org
You've gotten many good suggestions, but the main problem is that you
are doing a TCP ping, and I'm pretty sure you are expecting the results
to match your ICMP ping.
From the Perldoc:
You may choose one of six different protocols to use for the ping. The
tcp protocol is the default. Note that a
Here's one example of how you could go about it:
##
use strict;
use warnings;
my $testString = test_freq = 1.0001;;
print Test One: ;
if($testString =~ /=\s*([0-9.]+)\s*;\s*$/){
print $1;
}else{
print Failed!;
}
print \n;
##
You have an extra double-quote in there after the email address. So far
this doesn't seem to be a Perl problem.
-Original Message-
From: Mihir Kamdar [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 25, 2006 7:02 AM
To: Mr. Shawn H. Corey
Cc: beginners
Subject: Re: CSV file that can be
It depends on which program was used to create the executable. I don't
know about Perl2Exe, but PerlApp encrypts the contents of the
executables to prevent tampering.
-Original Message-
From: I BioKid [mailto:[EMAIL PROTECTED]
Sent: Friday, June 23, 2006 1:35 PM
To: Timothy Johnson
I suppose if you're looking for a decompiler you should probably know
the difference between a compiled and interpreted language. There are
two products that can package Perl scripts into executables, but even
they don't compile them.
-Original Message-
From: I BioKid [mailto:[EMAIL
To: Timothy Johnson
Subject: Re: Any PERL Decompiler / code ?
Hi johnson,
Thanks for your reply -
Infact I dnt which program was used to generate executable -
could you tell me any possible program to get the code out of it ?
funny thing is they dnt even have an extension name of .exe
for eg a file
Here's one thought:
Why not create a hash of arrays? Each hash key would be a column name,
and each record would be spread across the arrays using the same array
index. If you really wanted to get fancy you could create a hash of
cached results to speed up future queries. I wouldn't recommend
-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 14, 2006 8:02 AM
To: Timothy Johnson; Michael Oldham; [EMAIL PROTECTED] Org
Subject: RE: A loop to parse a large text file--output is empty!
From:Timothy Johnson [EMAIL PROTECTED]
snip
print
What are you trying to do, and how is it failing?
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael Goldshteyn
Sent: Tuesday, June 13, 2006 12:50 PM
To: beginners@perl.org
Subject: What is a prompt package that actually works on Windows
It is definitely not
One problem is that you are using the $_ variable twice.
while(FILE) assigns $_ to the current line being read, and
foreach(@array) assigns $_ to the current element of the array in
question.
It's usually a good idea to be more explicit anyway, and keep the $_
usage to a minimum so you don't
If you're looking to set up something like this, I strongly recommend
buying the Perl Dev Kit from ActiveState. You'll get PerlApp and
PerlMSI, which make distribution easy, and PerlTray, which makes writing
System Tray applets in Perl much easier.
You're probably also going to want to get
: Tuesday, June 13, 2006 7:13 PM
To: Timothy Johnson; [EMAIL PROTECTED] Org
Subject: RE: A loop to parse a large text file--output is empty!
Thanks Timothy. I tried the code you supplied and unfortunately the
output file is still empty. Do you think there might be a problem with
the regular expression
As long as you're sure that there aren't any commas in your data, you
could always do this:
my @records = split(/,/,$line,17);
This will limit your total records to 17, and will dump the rest into
the 17th record. Then you can split the last record again if you want.
If you have some
Win32 changes to the environment from within your script won't be
permanent, so that won't work unless you do the system call that sets
the environment variable permanently (and also the local one, because it
won't reflect the changes to the system call until it is invoked again).
Do you have
-Original Message-
From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 2:04 PM
To: beginners@perl.org
Subject: RE: parsing a CSV file with more fields than column names
Hello Rich
Hi, Chris, thanks for your response
See docs for perlfunc,
-Original Message-
From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 2:37 PM
To: beginners@perl.org
Subject: RE: parsing a CSV file with more fields than column names
Are you SURE that there might be commas in the other fields?
I would hope that whoever
Here's the offending line:
###
$TXT .= swrite(@ @ @,$rec,
$stats{virus}-{$rec}, $percent).%\n if $text;
###
The @ part is telling format to print up to 21 characters
of $rec and truncate the rest, left justifying it. If you want to make the
printout of $rec longer, add more of
-Original Message-
From: Bryan R Harris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 07, 2006 4:43 PM
To: Beginners Perl
Subject: Re: defaults
snip
Take this (lame) example of an RSVP to an invitation:
**
$_ = Bill, 3; # name, number of
Try this:
system( start evince /path/to/pdf.pdf );
Both cheap and nasty.
-Original Message-
From: Daniel Kasak [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 06, 2006 5:37 PM
To: beginners@perl.org
Subject: Windows: Fork and run a process in the background
Greetings.
I'd like
Here's one way to accomplish what you want, and it eliminates some of
the redundancy. BTW, get used to using strict. It really does help in
the long run and it's better to learn it early than to decide to go back
later and fix your old programs.
###
Check out the File::Find module. It should come standard with your
distribution.
-Original Message-
From: Nishi Bhonsle [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 31, 2006 2:39 PM
To: beginners@perl.org
Subject: Perl script to search and replace a string in a file
Hi:
I have the
Do you have control over the Windows box you will be using for these
scripts, or are these for a general distribution?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 25, 2006 4:21 PM
To: beginners@perl.org; [EMAIL PROTECTED]
Subject: Perl OS
-Original Message-
From: Ricky Zhou [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 25, 2006 5:30 PM
To: [EMAIL PROTECTED]
Cc: beginners@perl.org; [EMAIL PROTECTED]
Subject: Re: Perl OS system equivalence or Perl scripts for
UNIX-and-Windows
On 5/25/06, [EMAIL PROTECTED] [EMAIL
There is a COMPUTERNAME environment variable that will have this info.
-Original Message-
From: Japerlh [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 25, 2006 6:21 PM
To: beginners
Subject: Help: Is there any way to get the name of the Window Server
that the Perl script is currently
-Original Message-
From: Jeff Pang [mailto:[EMAIL PROTECTED]
Sent: Sunday, May 21, 2006 11:06 PM
To: beginners@perl.org
Subject: Re: Looking for example Perl scripts to be used in Perl
Training.
snip
I think both Learning Perl and Perl Cook Book are right for your
purpose.
I got
One simple thing you might want to start doing is including the filename
in your error message. Quite often this message means that either
you're not in the starting directory you think you're in or part of your
filename is being interpreted as something other than what you intended.
Check out the File::Find module. It should come standard with your
distribution. You may have to re-read the docs a couple of times before
it makes sense, but it works well. Post here if you have any problems.
-Original Message-
From: SkyBlueshoes [mailto:[EMAIL PROTECTED]
Sent:
1) Start--Run
2) In the text-box provided, type Powerpnt.exe
3) Click Ok.
4) In the application window that appears, click File--New
HTH!
-Original Message-
From: Japerlh [mailto:[EMAIL PROTECTED]
Sent: Friday, May 19, 2006 3:47 AM
To: beginners@perl.org
Subject: Help: Need PPT
One thing you could do is precompile the regex and save it in a variable
ala
my $regex = qr/.*ST\S+\s*\S*B15--.*[^02468]]/o;
my @match_sp = $all_lines =~ /$regex/mg;
Note the 'o' option on the qr//, which tells perl to compile the regex
only once.
I'm not sure if it applies in this case or
What operating system are you using?
-Original Message-
From: Shalaka [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 18, 2006 6:26 AM
To: beginners@perl.org
Subject: Any CPAN module similar to Winrunner
Hi List!
I'm a beginner in Perl,
i want to know if there is any module available
If you mean in the same order, then no.
perldoc -q order
-Original Message-
From: Gavin Bowlby [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 16, 2006 5:25 PM
To: beginners@perl.org
Subject: question on Perl determinism with hash keys
All:
If I populate a %hash within a Perl
PROTECTED]
Sent: Tuesday, May 16, 2006 5:37 PM
To: Timothy Johnson; beginners@perl.org
Subject: RE: question on Perl determinism with hash keys
Timothy et al:
Thanks, I did mean in the same order.
Any idea on the relative performance of a hash tied to IxHash vs. a
vanilla hash?
I have a Perl program
Understandable. Why do you need the keys function to return the keys in
the same order? What is it that you're trying to do?
-Original Message-
From: Gavin Bowlby [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 16, 2006 5:57 PM
To: Timothy Johnson; beginners@perl.org
Subject: RE
I had to deal with some of this when I recently wrote a BB agent to
Nagios translator in Perl.
You should be able to send the information you want directly to BB using
the IO::Socket module, connecting to port 1984( or whatever custom port)
on your BB server and sending a status message.
Big
..bbclient.log' for append!\n);
select OUTFILE;
$| = 1;
select STDOUT;
print IP=$host\n;
while(my $recv = $bbclient){
print OUTFILE $recv;
#print $recv;
}
}
-Original Message-
From: Timothy Johnson
Sent: Monday, May
If the server is a Windows server you can use the Win32::FileTime module
to get the info you need.
-Original Message-
From: Graeme McLaren [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 11, 2006 9:55 AM
To: beginners@perl.org
Subject: date time from server problem/question
Hi all,
Do something like this:
###
Win32::OLE-Option(Warn = \Error_Handler);
sub Error_Handler{
print WARN!!! .Win32::OLE-LastError.\n;
}
##
-Original Message-
From: Gallagher, Tim (NE) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 10, 2006 11:20 AM
To: Perl Beginners
-Original Message-
From: Bryan R Harris [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 09, 2006 11:24 AM
To: Beginners Perl
Subject: Re: array question
On Tue, 2006-09-05 at 18:33 +0200, Dr.Ruud wrote:
One exception: the pattern / / does not work like the pattern ' '.
But it should,
It would probably be better to let the OS tell you why the open failed
by using the $! or $^E variables when you're checking why the open()
failed. It could be failing because the file was not found, or the file
could be locked somehow, or the user might not have read permissions on
the file.
You could cycle through the array and use split() to split each element
by whitespace and then append the result to the @new_array array using
push();
-Original Message-
From: chen li [mailto:[EMAIL PROTECTED]
Sent: Monday, May 08, 2006 12:58 PM
To: beginners@perl.org
Subject: array
HTML email is pretty easy to do, especially for simple formatting.
There shouldn't be anyone out there that can't receive HTML email. If
you really want to accommodate everyone, you could add both the HTML and
text format emails. I'm not 100% sure how that one is done, but I know
it can be
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Anthony Ettinger
Sent: Monday, May 01, 2006 5:02 PM
To: Mr. Shawn H. Corey
Cc: beginners@perl.org
Subject: Re: executing block on STDIN
On 5/1/06, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote:
snip
I'm not
What happens if you are more specific?
@domain = split(/\w/,$domainlist);
-Original Message-
From: Rance Hall [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 26, 2006 1:22 PM
To: beginners@perl.org
Subject: problem with whitespace not splitting on split.
I'm working on a new perl
-Original Message-
From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 26, 2006 1:32 PM
To: Rance Hall
Cc: beginners@perl.org
Subject: Re: problem with whitespace not splitting on split.
On Wed, 2006-26-04 at 15:22 -0500, Rance Hall wrote:
I'm working on a new
The confusion comes from the poor wording of the perldoc.
As a special case, specifying a PATTERN of space (' ') will
split on white space just as split with no arguments does.
Thus, split(' ') can be used to emulate awk's default
behavior, whereas split(/ /) will give you as many
Just a thought, but couldn't you put the logic in your grep statement?
Something like this:
grep {defined($_-value()) or defined($_-part('Name')-value())}
@objects;
-Original Message-
From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 25, 2006 12:22 PM
To:
You mean like this?
perl -p -e s/\n/ /
(Some tweaking may be necessary for non-Win32 OS)
-Original Message-
From: Chad Perrin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 19, 2006 6:36 PM
To: beginners@perl.org
Subject: golf
This is kind of a frivolous question, but . . . is
You need to anchor your regex. Your regex is matching '!!' because it
is matching an exclamation point followed by zero or more non
exclamation-point characters anywhere in the string.
Thus the first '!' is matching the regex, and the second '!' is outside
of your match.
Try this:
You could always use backticks (``) to capture the output in an array
and then print it to a file.
-Original Message-
From: Irfan J Sayed [mailto:[EMAIL PROTECTED]
Sent: Monday, April 17, 2006 7:11 AM
To: beginners@perl.org
Subject: Catching the output in file
Hi,
I am executing
Was this logfile made by a particular product? There might be a module
made specifically for it.
-Original Message-
From: Joshua Colson [mailto:[EMAIL PROTECTED]
Sent: Monday, April 17, 2006 1:57 PM
To: Perl Beginners
Subject: Lexical analysis of log file
I have a log file of the
-Original Message-
From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
Sent: Friday, April 14, 2006 12:15 PM
To: beginners@perl.org
Subject: Re: regex matching conditionally
Timothy Johnson wrote:
Will the string always have the two quotes in the same place and only
one per string? What
You might want to add the $^E and $! error variables in your output.
I've been using rename with XP,W2k, and W2k3 for a few years now without
problems.
Another thought: Make sure that it's working in the directory you think
it is. It's pretty easy to accidentally copy the file somewhere else.
perldoc lib
-Original Message-
From: chen li [mailto:[EMAIL PROTECTED]
Sent: Friday, April 14, 2006 2:40 PM
To: beginners@perl.org
Subject: how to tell perl to look for where a new module is installed
snip
I install in new module like this:
c:/perl/local/new.pm.
How should tell the
not the first person
to have this problem, so it is good to get the information out there for
other beginners.
-Original Message-
From: chen li [mailto:[EMAIL PROTECTED]
Sent: Friday, April 14, 2006 2:44 PM
To: Timothy Johnson
Subject: RE: reverse the order of a row in Excel
Hi Timothy
.
# VMS users wanting to put [.stuff.moo] into
# their @INC would write
use lib 'stuff/moo';
-Original Message-
From: chen li [mailto:[EMAIL PROTECTED]
Sent: Friday, April 14, 2006 3:15 PM
To: Timothy Johnson
Subject: RE: how to tell perl to look for where a new
Will the string always have the two quotes in the same place and only
one per string? What about something like this?
/.*?\{([^\}]*)\}(?=.*)/gi
-Original Message-
From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 13, 2006 5:16 PM
To: beginners@perl.org
Subject:
The code you provided can't be the example taken straight out of
Programming Perl, because it doesn't compile. Also, you've mistyped one
of the variables. You should always use strict and use warnings to
avoid this kind of thing.
Can't call method name on an undefined value at
Do you have any experience using Win32::OLE with Excel? That would be
the way to go.
I got this going, and there is only one weird idiosyncrasy that I found.
When you input data into a range using the Values property you do it by
putting your data into an anonymous array, but when you retrieve
1 - 100 of 919 matches
Mail list logo