Hi,
I am interested to understand what this guy did, but i am unable to, can
someone please break it down to a newbie
I've spent the last several days at work, trying to "take over" some work
left behind by a departing colleague. I realized we didn't have some of his
bash scripting in ansible or
What is the correct way to quickly assign the result of a regex against
a cmdline arg into a new variable:
my $var = ($ARGV[0] =~ s/(.*)foo/$1/i);
Obviously that's incorrect but is there a quick way without intermediate
assignment?
Thanks!
jlc
--
To unsubscribe, e-mail:
Yes, you can use:
( my $var = $ARGV[0] ) =~ s/(.*)foo/$1/i;
Rob/Octavian,
Thanks for the quick help!
jlc
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
I am trying to write a script that takes the extend name as an arg and retrieves
the output for further processing.
I am not sure how to do this, get_request() needs a numeric oid, is there a
way around this or is get_request() not the best way to do this?
Thanks for any help,
jlc
--
To
I need a few modules not provided by Base or 3rd party rpm repos
and since I don't want to mess up the rpm db, I am installing these
cpan modules as non root into /opt/cpan by using 'makepl_arg' =
q[PREFIX=/opt/cpan]
The module I need is MIME::Tools which needs a newer File::Temp (0.16
versus
Inside a here doc, how can I force an expression to be evaluated
such as localtime:
print END;
`localtime time`
Foo
Bar
END
I know I can simply create the var before,
my $var = localtime time;
But just curious how to evaluate expressions inside this...
Thanks!
jlc
--
To unsubscribe,
Is it required to manually close a file handle I used
to write debugging info to when the Perl scripts exits?
Seems like a waste of effort at the end of the script to
test `if debug...` and close the fh after?
Thanks!
jlc
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional
You can use the trick mentioned in 'perldoc -q string' How do I expand
function calls in a string?
Funny that the perldoc uses the exact function I wanted to use:)
localtime is a Perl function, not an external command, so:
Thanks guys!
jlc
--
To unsubscribe, e-mail:
I get a page full of output from a command passed into a Net::Telnet session
that as per the cpan example is stored in $output. I then want to call a sub
passing $output into it, that matches a string against each line, and sets a
a var to OK if the match is successful.
All is well, but I am
use a named variable with foreach loops. sure some docs and examples
show using the default $_ but it can have problems with action at a
distance. also a name makes the code read better.
Ok, simple enough to do.
and where does $match get set? it must be from outside the sub so it is
a global.
nothing HAS to be global. you can pass it to a sub, you can store the
options in a hash (my way and easy with getopt::long), etc. some globals
may be useful but always using them or not know other ways is bad.
Ok, fair enough.
no. it is a single string with 4 lines in it. why would you think
so it could still likely use a review. especially if you are learning
perl. many doc examples aren't written to the best coding standards.
I'll take you up on that once its supposedly done:)
Many great tips, thanks for all the help!
jlc
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
That depends on exactly what you are trying to do, how big of a job
queue it should be, if there needs to be any feedback (like job status
and error messages) and such.
I for myself would go for a database backed system, as this implicitly
avoids things like race conditions and file lock
I have been pointed to a ksh script called qjob that implements a fifo queue.
As none of our servers use or have ksh, this presents a bit of a problem as it
also leverages a ksh implementation of a counting semaphore which would take
ages to rewrite.
I figure this is a job for Perl, but before I
I'm commenting on your code below with some general remarks. Not sure if this
will fix your problem.
Shlomi,
I greatly appreciate your time going through this, I have undergone rewriting it
from scratch with your suggestions. It was a script I copied from an existing
one
which was a bad idea:)
Hi,
I should state first I don't have the luxury of using Perl often
and am super rusty:)
I have a script that sends snmp commands to a switch either by passing
args directly or as stdin. It works when passing them directly, but
fails when feeding them as stdin, which is ultimately the way it
I have no idea what was wrong with me last night. You are absolutely
right, those are not in a sortable format.
All the replies led me down the path of enlightenment:) The string before
the @ will always be the same, in fact, I must error check for this, so
no need for a hash, I can just apply
Hi,
I have some data I will read into an array that is the format
some_string@date such as foo/bar/b...@07-23-2009-11.42.02.
To work with this, I will convert the date part (everything after
the @ to the epoch format so it's easy to sort accurately. I
figured I would create a hash with keys being
assist.
Joseph.
--
Isaiah 40:31 But they that wait upon the LORD shall renew their
strength...
Hello,
I am a complete beginner - no programming background.
I want to begin with Perl and I decided to by Randal's book *Learning Perl*.
I seem to have been progressing smoothly till when I arrived at the code
below on page 65.
my @names = qw/ tom fred dan betty roy /;
my $result =
In another list, I am baffled by the instability of a Perl script that freezes
after some time for a user. What can be done to run a Perl script in a debug
like mode such that all system calls could be logged so that one could see what
was attempted for execution by the script as it hung?
I am trying to replace all occurrences of a windows path such as C:\Dir 1\Dir
2\Dir with more spaces to a similar path, and have it case insensitive, and I
can't make it work.
Anyone got an idea? I am hoping the syntax is compatible with Sed as my script
has to be ran in two mode's, one being
I don't understand why you would run sed. Perl can be run from the
command line by hand as well.
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
Yeah, sorry should have been more clear. The server that will run the Sed based
section
How about providing the code that you are working with?
This ought to work:
s/C:\\Dir 1\\Dir 2\\Dir with more spaces/replacement/
__CODE__
$in = 'C:\Dir 1\Dir 2\Dir with more spaces'; $in =~ s/C:\\Dir 1\\Dir
2\\Dir with more spaces/replacement/; print $in\n; __OUTPUT__
replacement
I had not
How does one do this? I have the output in a script set to a variable such as:
my $var = `cmd --arg1 --arg2 | egrep 'This|That'` and I don't want to see it as
the script is run.
Thank you,
jlc
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
That should be one process not on process. It is important, and I
forgot to add this, to use waitpid* to reap the child process after an
open3 unless you don't mind zombies.
* http://perldoc.perl.org/functions/waitpid.html
Thank you Chas and yitzle
jlc
--
To unsubscribe, e-mail: [EMAIL
Suggestion: rather than use egrep (which, as Chas points out, requires
a new process - and ignoring his solution for a moment - sorry), it
might make more sense (and increase portability) to move the RegEx
parsing into Perl.
my $var = grep {/This|That/}, `cmd --arg1 --arg2;
(Did I do this
I have a need at work to monitor external I/O from a PC. Basically I need to
turn outputs on and off and monitor some various inputs for different ranges.
Since I know *some* Perl and the PC won't be doing anything else I am not
worried about making sure the code is enterprise scalable. Is
I just loaded WinXP on my wife's computer. I hate that OS.
So? It works for billions of other people and companies, what does that say?
They are _all_ 'uninformed' and you are?
Relevance to the issue?
I just noticed that the command prompt window scrolls
real slow. I did some searching and
I need to make some edits on small (~30 lines) text files. From reading perldoc
and recent posts, am I correct in understanding that the proper way is to read
the file in through one handle and write it out through another? If that is the
case, I suppose I need to write in some code then to
My whole project got too messy so I decided to use an existing XML file to load
in all the needed input I would require.
I have the following code but fail to access to data in $workspace.
my $workspace = XMLin($ARGV[0], forcearray = 1);
print Dumper($workspace);
print
does one write that?
As an example
While ($workspace-{stuff}) {
print $workspace-{stuff}-{Iterated element}-{type}\n;
}
Thanks!
jlc
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix
Sent: October-19-07 3:32 PM
To: Joseph L. Casale
Cc
Is there a way to compute the size of a hash?
I have a hash of hashes of hashes etc... and need to know how many items exist
in the second hash. I know they are always named as integers from 0 up. I was
hoping to get info I need out of with a loop incrementing up until etc.
Does such a method
be a way to make sure I am reading the data I want?
Send me another nudge :)
Thanks!
jlc
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix
Sent: October-19-07 12:19 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: Read in XML File for input
Sorry, it is an array I used above this block of code.
jlc
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yitzle
Sent: October-19-07 11:16 AM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: Printing size of array unitializes array?
What are you
Now I got it...
That was a bit of a stretch for my experience:)
print $workspace-{TextHere}-[0]-{content}\n;
Thanks!
jlc
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix
Sent: October-19-07 12:19 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Thank you!
jlc
-Original Message-
From: Paul Lalli [mailto:[EMAIL PROTECTED]
Sent: October-19-07 10:35 AM
To: beginners@perl.org
Subject: Re: Assemble file and directory name for copy
On Oct 19, 12:13 pm, [EMAIL PROTECTED] (Joseph L. Casale)
wrote:
I am using File::Path and need
I am using File::Path and need to assemble a directory without a trailing
backslash, $Dir and a file, $File for copy.
I can't get the syntax right to assemble the path inside the copy?
I need something like:
Copy ($FromDir . \ . $File, $ToDir . \ . $File)
Any ideas?
Thanks!
jlc
I had the following code:
open (FILEOUT, $OutDir/info) or die $!;
print FILEOUT text = abc\n;
my $Tmp = ++$#files;
print FILEOUT moretext = $Tmp\n;
When I add the 3rd line, it initializes the files array and I can't use it
after? Why is that?
I
Hi All,
I am needing to perform some work on files located in a directory. I am reading
the contents of the directory in and but need to filter what's read in. So far
I can filter out the . and .. but I need to add two more cases. I need to
make sure none of the entries in the array are
Message-
From: Chas. Owens [mailto:[EMAIL PROTECTED]
Sent: October-18-07 2:53 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: Filtering output of readdir
On 10/18/07, Joseph L. Casale [EMAIL PROTECTED] wrote:
Hi All,
I am needing to perform some work on files located in a directory
Thanks Chas and Tom, its working great.
jlc
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
I have to search for text strings in files and then do something with the line
that matches in one scenario and in another I need to store the contents of the
following n lines.
In the first requirement I think I have it beat, but I am lost on the second. I
thought I might be able to search
I was following the previous mp3 thread with interest, does anyone know if
there exists a module that can not only write tags but imbed the album art as
well?
Thanks!
jlc
Hi All,
I have two questions, is it correct to execute subs like this:
Sub_1 (sub_2))? I am trying to pass the return value of sub_2 into sub_1.
Also, I have been looking at perldoc etc to limit the # of digits returned
after a decimal, it looks difficult? Am I overlooking a simple method?
Nice!
Thanks,
jlc
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 24, 2007 10:24 AM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: Rounding and Subs
On 7/24/07, Joseph L. Casale [EMAIL PROTECTED] wrote:
Hi All,
I have two questions
Hi guys,
I must have been dreaming when I tested this and ran it the first time as I
thought it worked! Now it's not :P
Anyone know what's wrong here, can I not leverage the expand sub to convert the
scientific notation in the printf statement like I am?
sub expand {
my $n = shift;
Sorry,
I am still getting the scientific notation in the output instead of standard
notation.
Thanks!
jlc
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 2:09 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: Scientific Number problem
Right!
It can be either, I missed that...
Thanks Chas!
jlc
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 2:18 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: Scientific Number problem again!
On 7/23/07, Joseph L. Casale [EMAIL
:08, Joseph L. Casale wrote:
Is that true?
I use while loops and they cycle through each line without me keeping
track? jlc
Yeah, it's true. Why would you want to keep track?
(you can BTW, look at perldoc perlvar for $.)
in my code, the 1st line is written into $prev. This code will fail
How can I detect this, I have been running some code for a few days to develop
some files and ran into the situation where I am getting the following data for
input:
14.95313 14.45312 0
14.95313 1.570813E-015 0
14.95313 -14.45313 0
-14.95313 -28.90625 0
-14.95313 -14.45313 0
-14.95313
Notation to decimal equivalent
El Jul 18, 2007, a las 11:19 PM, Joseph L. Casale escribió:
How can I detect this, I have been running some code for a few days
to develop some files and ran into the situation where I am getting
the following data for input:
14.95313 14.45312 0
14.95313
Chas,
Sorry but I am not clear on what you mean by reduce? Do you mean remove all non
numbers from the array?
Thanks!
jlc
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2007 4:31 PM
To: Joseph L. Casale
Cc: Xavier Noria; beginners@perl.org
One of these scripts has a loop like this:
for my $line (@lines){
my $line2 = $line;
$line =~ s/(\S+)\s+(\S+)\s+(\S+)/X$1 Y$2/;
print FILEOUT $line;
$line2 =~ s/(\S+)\s+(\S+)\s+(\S+)/Z[$3+DPad]/;
print FILEOUT $line2;
print FILEOUT M98PDRILL.SUBL1\n;
print FILEOUT G90\n;
print FILEOUT G00
Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Friday, July 13, 2007 7:09 PM
To: beginners@perl.org
Cc: Joseph L. Casale
Subject: Re: Search and Replace
Joseph L. Casale wrote:
One of these scripts has a loop like this:
for my $line (@lines){
my $line2 = $line;
$line =~ s/(\S
: Wednesday, July 11, 2007 4:52 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: Search and Replace
Joseph L. Casale wrote:
Paul,
Reading the perlre doc I am starting to understand this line:
$line =~ s/(\S+)\s+(\S+)\s+(\S+)/X$1 Y$2 Z$3/;
I have a few questions.
1. What is the tilde
Ok Rob,
I'll have a look.
Thanks!
jlc
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 12, 2007 1:22 PM
To: beginners@perl.org
Cc: Joseph L. Casale
Subject: Re: Search and Replace
Joseph L. Casale wrote:
How can I make this expression:
$line =~ s/(\S
Hi,
Know that I am learning perl, I am expected to use it at work :)
Problem is I am still to green for the current problem I have. The data is
always left justified and has a space between each value.
I have a text file of about ~500 lines like this:
-11.67326 23.95923 0.4617566
5.075023
To: beginners@perl.org
Subject: Re: Search and Replace
On Jul 11, 1:50 pm, [EMAIL PROTECTED] (Joseph L. Casale)
wrote:
Hi,
Know that I am learning perl, I am expected to use it at work :)
Problem is I am still to green for the current problem I have. The data is
always left justified and has
-Original Message-
From: Paul Lalli [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 12:30 PM
To: beginners@perl.org
Subject: Re: Search and Replace
On Jul 11, 1:50 pm, [EMAIL PROTECTED] (Joseph L. Casale)
wrote:
Hi,
Know that I am learning perl, I am expected to use it at work :)
Problem
Chas/Prabu,
The script is moving along nicely now:)
Incredible how I missed the obvious, although I have been staring at it for so
long...
Thanks!
jlc
-Original Message-
From: Prabu Ayyappan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 04, 2007 11:16 PM
To: Joseph L. Casale
I am reading perldoc.perl.org and am not understanding exit and die clearly.
If I have a conditional in a sub that I want to validate with, what is the
correct way to do the following:
1. End the sub and return back to the script without continuing that sub.
2. End the entire
Yup, lol...
Wish I understood this! What is the line that does the search called? What do I
look up to read up on this?
Thanks!
jlc
From: Prabu Ayyappan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 03, 2007 10:55 PM
To: Joseph L. Casale; beginners@perl.org
Subject: Re: formatting a string
I have a list:
@list = ('Exchange','Filter','DNS','Domain');
This is a list of arrays I also have of course to leverage this I am trying to
. the @ symbol on it during use.
foreach $vm (@list) {
my_sub(@ . $vm);
print @ . $vm\n;
}
The print likes this, but the
Hi,
I am trying to use the following:
($volume,$directories,$file) =
File::Spechttp://perldoc.perl.org/File/Spec.html-splitpath( $path );
I am leveraging this fine, but would like to shove the last directory from the
path in $directories into a new var.
Is there a function from this module
Just found that. I suppose I could use it, then get the size of the array and
use the last indices? Is there a cleaner way to do it?
Thanks!
jlc
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix
Sent: Wednesday, July 04, 2007 1:38 PM
To: Joseph
Dang, you perl guys thought of everything!
Thanks!
jlc
From: Chas Owens [EMAIL PROTECTED]
Sent: Wednesday, July 04, 2007 3:21 PM
To: Joseph L. Casale
Cc: Tom Phoenix; beginners@perl.org
Subject: Re: File::Spec-splitpath
On 7/4/07, Joseph L. Casale [EMAIL
I have the following code (it's a snippet so it may seem silly, but altogether
it would make sense as I am forcing one array into it for a test):
#!/usr/bin/perl -w
@DNS = (/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/Web DNS (Win2003
Std x32)/Web DNS (Win2003 Std
?
So the `/usr/bin/vmware-cmd \$_[0]\ gettoolslastactive -q`; is correct where
the var gets inserted?
Thanks!
jlc
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 04, 2007 8:15 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: syntax error
Heh, I am running out of hair:P
I get two errors to start, one is the warning that is better write:
my ($vm) = $_[0];
instead of
my ($vm) = @_[0];
And the other is about the use of the global @_ (huh) with my?
I have this now:
#!/usr/bin/perl -w
@Exchange =
Heh,
Clearly I need to sleep!
This doesn't even work either?
#!/usr/bin/perl -w
@list = (Exchange,Filter,DNS,Domain)
sub stop_it {
$vm = $_[0];
print $vm\n;
}
stop_it(@list)
What is wrong here?
jlc
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
I have an array with the following data in it:
/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/AN-DC
(Win2003 Ent x64).vmx
/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/Disc
1.vmdk
/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC
I want to script an if based on two conditions, var1=0 and var2=1.
Is there some quicker way to write this in one if statement like:
If ($var1=0 ?and? var2=1) {
Do my stuff
}
I know I can nest a second if, but just hoped I could do it quicker :)
Thanks!
jlc
: Monday, July 02, 2007 11:05 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: Conditional question
On 7/3/07, Joseph L. Casale [EMAIL PROTECTED] wrote:
I want to script an if based on two conditions, var1=0 and var2=1.
Is there some quicker way to write this in one if statement like
you want to be extracted, it's nice also if you can
provide a snippet of your effort.
/joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi all,
Hello,
If I have a file that has ...
A
A
B
C
D
D
D
E
E
F
F
G
How do I remove the duplicates via a Perl script?
perldoc -q How can I remove duplicate elements from a list or array
One way to do it:
prefer using a script is so am not putting loads into the database
not to
mention that I can put more logic into the script than on the SQL
statement.
Any advise or other options will be very much appreciated Thanks in
advance.
welcome, HTH.
/joseph
--
To unsubscribe, e-mail: [EMAIL
Hi List,
Again I need your help, script in question is here:
#usr/local/perl -w
use strict;
use Socket;
open(OUTPUT,iplisted.txt) or die can't open iplisted.txt $!;
foreach (DATA) {
s/\s+//;
my $address = $_;
my $name = gethostbyaddr(inet_aton($address), AF_INET)
or die Can't
Thomas B�tzler [EMAIL PROTECTED] wrote: Hi,
joseph tacuyan asked:
#usr/local/perl -w
use strict;
use Socket;
open(OUTPUT,iplisted.txt) or die can't open iplisted.txt
$!; foreach () { s/\s+//; my $address = $_; my $name
= gethostbyaddr(inet_aton($address), AF_INET
Rob Dixon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
joseph wrote:
Rob Dixon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
joseph wrote:
I need help with my script, this supposedly would check a workstation
listed in one file then see if it's not listed
Hi list,
I need help with my script, this supposedly would check a workstation listed
in one file then see if it's not listed on other file, if it 's the case
then append it on an output file.Basically what i got is the same unmodified
list just appended on the output file. Where did i got
Jeff Peng [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
my %hash = map { $_ = 1 } @pclist;
above is wrong.It should be:
my %hash = map { $_, 1 } @pclist;
HTH.
Thank you Jeff, unfortunately still it didn't solve the problem.
/jbt
--
To unsubscribe, e-mail: [EMAIL
Rob Dixon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
joseph wrote:
I need help with my script, this supposedly would check a workstation
listed
in one file then see if it's not listed on other file, if it 's the case
then append it on an output file.Basically what i
.
$$SMS_DISCOVERY_DATA_MANAGERFri Jul 14 13:22:00.977 2006 Malay Peninsula
Standard Timethread=3480 (0xD98)
==Name = WKSMDE05612
TIA for any pointers and tips.
/joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http
.
/joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
... for how many times i had checked it, what a hard learned lesson.
thanks.
/joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Jeff Peng [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
How about your two files?I should give a general way for comparing two
files:
use strict;
open TXT1, 1.txt or die $!;
open TXT2, 2.txt or die $!;
my %diff;
$diff{$_}=1 while (TXT2);
while(TXT1){
print unless
All,
Just like to ask for correction on what's wrong with my script it gives spit
out this error when i run it.
Unsuccessful open on filename containing newline at disksize.pl line 8.
Can't open file No such file or directory
But it runs without this error whenever i feed it up when an
Mr. Shawn H. Corey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Tue, 2006-06-06 at 18:59 +0800, joseph wrote:
All,
Just like to ask for correction on what's wrong with my script it gives
spit
out this error when i run it.
Unsuccessful open on filename containing newline
John W. Krahn [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
joseph wrote:
All,
Hello,
Just like to ask for correction on what's wrong with my script it gives
spit
out this error when i run it.
Unsuccessful open on filename containing newline at disksize.pl line 8.
Can't
Muma W. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
joseph wrote:
All,
Just like to ask for correction on what's wrong with my script it gives
spit out this error when i run it.
Unsuccessful open on filename containing newline at disksize.pl line 8.
Can't open file
Xavier Noria [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Jun 6, 2006, at 14:16, John W. Krahn wrote:
Mr. Shawn H. Corey wrote:
$output_file =~ s/\r//g;
# chomp only removes linefeed characters \n
# BTW, there is no such thing as a newline;
# it is either a linefeed: \n
logs.
with my script above I got only the END_TIME/format/here section, I've tried
also reading it by paragraph but to no avail, is there any modules or tricks
to do the job?
As always.thanks a lot.
/joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Mr. Shawn H. Corey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Mon, 2006-05-06 at 08:51 +0800, joseph wrote:
Hello List,
I need help in extracting a range of lines from a log files, i tried to
do
it with this script:
#!/bin/perl
use strict;
use warnings;
open
Mr. Shawn H. Corey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Mon, 2006-05-06 at 10:20 +0800, joseph wrote:
@line = () if /^DATE:/; ## set array @line to an empty list if line begin
DATE?
Yes, this will clear out the previous record.
push @line, $_; ## then push
Hi Mandeep,
Thanks a lot, your first option works i've just add another switch -v to
mail for it looks for recepient address without it.
Anyway, i will look at the second option too next.
with thanks,
/joseph
íÁÎÄÉÐ óÉÎÇÈ âÈÁÂÈÁ [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED
List,
Good day!
I'm trying to rewrite a bash script into perl as to aid my learning
experience.Supposedly this script would do these things;
1. Open the logfiles.
2. Check the last portion of files.
3. Check the log for an ERROR string.
4. If error is present mail.(I'm stuck here i dunno how
.
/joseph
perl convert.
-
Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo!
Messenger with Voice.
will get this to be informed.
--
Joseph A. Ruffino
Gail Borden Public Library District
Automated Systems Assistant
270 N. Grove Ave.
Elgin, IL 60120
Phone: (847) 429-5986
Fax: (847) 602-5029
http://www.gailborden.info
.
--
Joseph A. Ruffino
Gail Borden Public Library District
Automated Systems Assistant
270 N. Grove Ave.
Elgin, IL 60120
Phone: (847) 429-5986
Fax: (847) 602-5029
http://www.gailborden.info
1 - 100 of 1222 matches
Mail list logo