The following script is not appending to the file for some reason.
Please bestow your wisdom on me oh great Perl gods. :-)
--
#!/usr/bin/perl -w
my $size=0;
my @stat;
open(TEMPFILE, /temp/temp.big_ass_file) or die unable to
Nathaniel == Nathaniel J Wert [EMAIL PROTECTED] writes:
Nathaniel The following script is not appending to the file for some reason.
Nathaniel Please bestow your wisdom on me oh great Perl gods. :-)
Nathaniel
Nathaniel --
On Wed, 18 May 2005, Wert, Nathaniel J wrote:
open(TEMPFILE, /temp/temp.big_ass_file) or die unable to write
/temp/temp.big_ass_file:$\n;
On most Unix systems I've used, the name is usually /tmp, not /temp.
If you're trying to work on a file in a nonexistent directory, you
probably won't get
I guess I should give a little more in depth explanation. The file and
directory does exist. The names are changed to protect the innocent (I
did not want to use the tmp dir). This is basically to simulate a large
log file having entries written to it every second. This is a section
of a
Actually, with the help of another person here we figured out what was
wrong. Apparently there is a problem with the sleep() function where it
interferes with the open() of the file. We have found three ways of
fixing this. system(sleep 1); instead of sleep() or using fopen instead
of open. I
Nathaniel == Nathaniel J Wert [EMAIL PROTECTED] writes:
Nathaniel Actually, with the help of another person here we figured
Nathaniel out what was wrong. Apparently there is a problem with the
Nathaniel sleep() function where it interferes with the open() of the
Nathaniel file.
That can't be
Please excuse my lack of knowledge in this subject. The original script
executes every statement and in the process, it erases the file when it
does the open and then proceeds to not write to the file at all. Is the
text that is supposed to be written to the file stored in a buffer while
the
Wert, == Wert, Nathaniel J [EMAIL PROTECTED] writes:
Wert, Please excuse my lack of knowledge in this subject. The original script
Wert, executes every statement and in the process, it erases the file when it
Wert, does the open and then proceeds to not write to the file at all. Is the
Wert,
Hi everybody,
to extract data columnwise from a file, the following code was written with
the help of perl experts of this list. the script is as follows:
#!usr/bin/perl
On May 18, 2005, at 7:55, Aditi Gupta wrote:
is guess_alphabet a predefined function in the following code?
my @counters = ();
while (my $row = $fh) {
my @cols = split /\s*-\s*/, $row;
for (my $i = 0; $i @cols; ++$i) {
my $code = guess_alphabet($cols[$i]);
[EMAIL PROTECTED] wrote:
Hi all
Hello,
I am trying to learn perl. I am using perl afs module to administer our
afs cell. my problem is, the attached script is forking a new process
and is not releasing the memory as iam new to programming I am pretty
sure i am doing some simple mistake I would
From: Aditi Gupta [mailto:[EMAIL PROTECTED]
Hi everybody,
to extract data columnwise from a file, the following code
was written with the help of perl experts of this list. the
script is as follows:
--
On May 18, 2005, at 8:03, Aditi Gupta wrote:
for (my $j=0; $j$x; $x++)
The last one would surely be $j++.
the code isn't giving any errors but it also isn't printing the
result as
well. Please someone tell me why is this happeining..
Please, next time format your code using standard conventions,
Aditi Gupta [EMAIL PROTECTED] wrote:
to extract data columnwise from a file, the following code
was written with the help of perl experts of this list. the
script is as follows:
#!usr/bin/perl
use warnings;
use strict;
my %hash;
$file= try.txt;
open (FH, $file) or die;
@rows=FH;
Thanks eveybody..
Knowing how to debug programs will always help. And i'm sorry for not
formatting the program according to standard conventions.. i'll do that in
future.
thanks Thomas for the help:-)
On 5/18/05, Ankur Gupta [EMAIL PROTECTED] wrote:
From: Aditi Gupta [mailto:[EMAIL
Hi all,
I am looking for a module helping me to format html to plaintext.
I searched in the web and find 2 seems related:
1. HTML::FormatText - Format HTML as plaintext
2. html2text-0.003
But it stated that Formatting of HTML tables and forms is not
implemented..
Do you have any suggestions that
Hi,
Thats really neat way of writing the expression I was looking for.
But somehow I couldnt get the following compiled. It says
Search pattern not terminated at ./a.pl line 8
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6
7 my $a=1: 192.168.0.180:32866
Hi,
Thats really neat way of writing the expression I was looking for.
But somehow I couldnt get the following compiled. It says
Search pattern not terminated at ./a.pl line 8
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6
7 my $a=1: 192.168.0.180:32866
I guess I am running into all sorts of problem with this program.
Can any body please explain me the compilation error...
syntax error at ./a.pl line 11, near #if($a =~ /((?:
(Might be a runaway multi-line ?? string starting on line 8)
Execution of ./a.pl aborted due to compilation errors.
1
Manish Sapariya [MS], on Wednesday, May 18, 2005 at 11:12 (+0530)
typed:
MS Thats really neat way of writing the expression I was looking for.
MS But somehow I couldnt get the following compiled. It says
heh, ok, this will work:
#!/usr/bin/perl
use strict;
use warnings;
my $a=1:
Hi Ing,
example u gave compiles well and after
diffing your and my code it shows that
the single quotes in
my $ip = '((?:\d{1,3}\.){3}\d{1,3})'
made the code compile.
Thanks for the help.
Regards,
Manish
On 05/18/2005 02:49 PM, Ing. Branislav Gerzo wrote:
Manish Sapariya [MS], on Wednesday, May
While using MIME::Entity smtpsend method I ran across some
problem and wanted to add some debug messages in the module
code. To my surprise the smtpsend() subroutine in the Internet.pm
never gets called by the perl code. However subrouting in following
Hi,
I'm trying to call gpg externally as part of a small script to import a
key and then trust it. It seems that to trust a key, once I've imported
it, I must enter the gpg interactive shell. Is there a way to pass
commands to this external shell, and then return to my script once it's
been
Hi,
I'm searching the Perl Sourcecode for the description of the Tokens, that the
yacc Grammar file (perly.y) use. I found only a file with the parser-code for
the lexer. Does anyone know where I can find the Regular Expressions ?
Thanks,
Andre
On Wed, 18 May 2005, Andre Muench wrote:
I'm searching the Perl Sourcecode for the description of the Tokens,
that the yacc Grammar file (perly.y) use. I found only a file with the
parser-code for the lexer. Does anyone know where I can find the
Regular Expressions ?
Did you not look at
On Wed, 18 May 2005, D. J. Birkett wrote:
I'm trying to call gpg externally
Why? Can't you just use something like Crypt::GPG?
http://search.cpan.org/~agul/Crypt-GPG-1.52/GPG.pm
You could solve this the way you're trying to solve it, but the GPG
module is probably going to be easier.
Charles and the Perl beginners,
thx for the response. But how do I ,from below, convert seconds old to a
date?
From my docs Mtime shows me a timestamp of when the file was last changed.
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
Hi Peter,
Thanks for your patient and detailed answers.
I have examined the XML file and all Topic/with link/ children are
followed by their own ExternalPage/s. If there is a Topic/ without
link/ inside, it is followed by a new Topic/. So I think your codes are
safe enough to use :-).
However,
Sorry Peter,
I know the answer of second question after reading a quick reference of
twig...
Nan
From: Nan Jiang [EMAIL PROTECTED]
To: [EMAIL PROTECTED], beginners@perl.org
Subject: Re: Errors on processing 2GB XML file by using XML:Simple
Date: Wed, 18 May 2005 13:44:22 +
Hi Peter,
Thanks
I know the answer of second question after reading a quick reference of
twig...
You know the answer to your first question as well - you've been looking at
it the whole day :)
I have examined the XML file and all Topic/with link/ children are
followed by their own ExternalPage/s. If there
Hi,
If I run ActivePerl under Windows 2000, could I face problems if I install
modules using both ppm and cpan and compiling the tar balls?
Could there be any binary incompatibilities?
Thanks.
Teddy
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Chris Devers wrote:
On Wed, 18 May 2005, D. J. Birkett wrote:
I'm trying to call gpg externally
Why? Can't you just use something like Crypt::GPG?
http://search.cpan.org/~agul/Crypt-GPG-1.52/GPG.pm
This script is to be run from an nfs mount on many systems, so it has to
run with the modules
Hi,
I have perl/tk application, where it fetches the data over the internet and
displays it in a ROText widget.
Everything works but in the output there is a square *like* symbol printed
at the end of each line too. I can not copy and paste the symbol either.
I donot understand if it is a perl or
My goal is to get element 9 of stat which is mtime. I am getting this
with
ease, but my end goal is to convert this number back into a readable
format
giving me how old the file is.
So here is a rough draft formula : (time in seconds - last MTime ) =
seconds old.
Convert seconds old to a
- Original Message -
From: [EMAIL PROTECTED]
Date: Wednesday, May 18, 2005 2:05 pm
Subject: square symbol at end of each line
Hi,
Hello
I have perl/tk application, where it fetches the data over the
internet and
displays it in a ROText widget.
Everything works but in the output
The square symbol likely represents a carriage return. Windows and Unix do
not like each other's carriage returns and sometimes when you cross
information from one platform to another you get this funny square. You can
get rid if it by:
s/\015//;
or substitute it with a newline character
- Original Message -
From: [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Wednesday, May 18, 2005 1:17 PM
Subject: RE: square symbol at end of each line
The square symbol likely represents a carriage return. Windows and Unix do
not like each other's carriage returns and sometimes when
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Sent: Wednesday, May 18, 2005 1:13 PM
Subject: Re: square symbol at end of each line
- Original Message -
From: [EMAIL PROTECTED]
Date: Wednesday, May 18, 2005 2:05 pm
Subject: square
Is there a way to pass variables from a perl script to know when it ends to
VB?
David R. DiGregorio
Vocollect
703 Rodi Road
Pittsburgh, PA 15235
P. 412-349-2440
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
-CONFIDENTIAL, PRIVILEGED COMMUNICATION-
This e-mail transmission is private
Hi List
I've been pottering away trying to get utf-8 behaving on my set up and
have nearly got there but then the client phoned up saying that the £
symbol was being displayed as a ?
The first page contains several languages and a £ sign and all is
displayed fine.
ok here is what I did:
I took
(now in seconds - last MTime ) = seconds old
seconds old / ( 60x60x24)
the divisor gives me in days how old the file is.
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
DiGregorio, Dave wrote:
Is there a way to pass variables from a perl script to know when it ends to
VB?
Same way you pass a kidney stone ;)
Sorry I couldn't resist ;p
Seriously though what have you tried?
how is Perl communicating with VB?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Hello:
I've long used Perl's in place edit feature, and understand it and regex
fairly well, e.g.:
perl -i -p -e s/oldhostname/newhostname/g /etc/hosts
However, what is the syntax if I wanted to just process a text stream to
stdout?, e.g.:
cat /etc/hosts | perl s/in_text/out_text/g
I'm sure
Hello,
I have an XML file that I need to import to a database, however, searching
CPAN for XML brings up a lot of stuff. I don't know what I need to know.
:(
What module should I use for something simple like the following data?
Can someone provide an example, or direct me to some good docs
I would throw the sterling sign out of the source document, and substitute
pound; or #xa3; or #163; (semi-colon is important!). I think that would
probably work across all platforms and browsers.
HTH, rgds, GStC.
- Original Message -
From: angie ahl [EMAIL PROTECTED]
To:
On Wed, 18 May 2005, Lance Murray wrote:
However, what is the syntax if I wanted to just process a text stream
to stdout?, e.g.:
cat /etc/hosts | perl s/in_text/out_text/g
I'm sure the answer is fairly simple. I'd just like to use perl one
liners in place of awk, cut, grep statements (and
Scott Taylor wrote:
Hello,
I have an XML file that I need to import to a database, however, searching
CPAN for XML brings up a lot of stuff. I don't know what I need to know.
:(
What module should I use for something simple like the following data?
Can someone provide an example, or
I can confirm that it's happening before the data's gone to the
database or anything.
I'm getting the params from CGI.pm and then decoding via decode(utf8, $v)
The page the params came from is set as utf-8 in the http header and
content type and firefox is believing the page is utf-8.
It looks
Lance Murray wrote:
Hello:
Hello,
I've long used Perl's in place edit feature, and understand it and regex
fairly well, e.g.:
perl -i -p -e s/oldhostname/newhostname/g /etc/hosts
However, what is the syntax if I wanted to just process a text stream to
stdout?, e.g.:
cat /etc/hosts | perl
On 5/18/05, Chris Devers [EMAIL PROTECTED] wrote:
On Wed, 18 May 2005, Lance Murray wrote:
However, what is the syntax if I wanted to just process a text stream
to stdout?, e.g.:
cat /etc/hosts | perl s/in_text/out_text/g
I'm sure the answer is fairly simple. I'd just like to use
On 5/18/05, angie ahl [EMAIL PROTECTED] wrote:
I can confirm that it's happening before the data's gone to the
database or anything.
I'm getting the params from CGI.pm and then decoding via decode(utf8, $v)
The page the params came from is set as utf-8 in the http header and
content type
Now I have. But what I am searching for, is the definition of the tokens in
a Perl File, like WORD, THING and so on, as used in perly.y . Didnt find
anything like this in the files you had pointed me to.
- Original Message -
From: Chris Devers [EMAIL PROTECTED]
To: Andre Muench [EMAIL
On May 18, Lance Murray said:
perl -i -p -e s/oldhostname/newhostname/g /etc/hosts
However, what is the syntax if I wanted to just process a text stream to
stdout?, e.g.:
cat /etc/hosts | perl s/in_text/out_text/g
Simple: use the -p and -e switches, but not the -i switch.
--
Jeff japhy Pinyan
Wiggins d'Anconia said:
Scott Taylor wrote:
Hello,
I have an XML file that I need to import to a database,
snip
What module should I use for something simple like the following data?
I would start with XML::Simple until you need more.
use XML::Simple;
my $xs = new XML::Simple;
my
Hi John W. Krahn, you wrote:
Thanks for taking the time for this detailed explanation!
If I understand you correctly then this will do what you want:
$str =~ tr/ //s;
Or if you want a slower method:
$str =~ s/ +/ /g;
This might sound a strange question, but why is the first one faster?
Or
On May 18, Dale said:
Hi John W. Krahn, you wrote:
If I understand you correctly then this will do what you want:
$str =~ tr/ //s;
Or if you want a slower method:
$str =~ s/ +/ /g;
This might sound a strange question, but why is the first one faster?
The first one is not a regex, it's merely a
Hi Jeff 'japhy' Pinyan, you wrote:
On May 18, Dale said:
Hi John W. Krahn, you wrote:
If I understand you correctly then this will do what you want:
$str =~ tr/ //s;
Or if you want a slower method:
$str =~ s/ +/ /g;
This might sound a strange question, but why is the first one faster?
The first
I'm looking at the source code for queue.pm and I'm quite surprised at how
short it is. I have some questions about the syntax.
(1) What does this colon (: shared) mean on line 69? I have not seen a
colon used like this before.
67 sub new {
68 my $class = shift;
69 my
Jeff 'japhy' Pinyan wrote:
On May 18, Dale said:
I thought that I could remove lines from the data by matching whether
the first character was a letter by using the 'if' statement as :
if(substr($line,0,1) eq [a-zA-Z])
...but this doesn't work. Neither does :
if($line eq [\s\d])
...to try and
Siegfried Heintze wrote:
I'm looking at the source code for queue.pm
Perl is case sensitive so that should be Queue.pm.
and I'm quite surprised at how
short it is. I have some questions about the syntax.
(1) What does this colon (: shared) mean on line 69? I have not seen a
colon used like
I am getting this error, can anyone help?
thanks
derek
# perl -c dir.pl
Useless use of sprintf in void context at dir.pl line 29.
dir.pl syntax OK
#!/usr/bin/perl
use strict;
use warnings;
use Time::localtime;
$ENV{PATH} = qq(/opt/SUNWsamfs/sbin:/usr/bin:/usr/sbin:/usr/local/log);
my $hdir =
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
: I am getting this error, can anyone help?
:
: sprintf (%.03f,($now - (stat(${hdir}${file}))[9])/86400);
Use either of these:
print sprintf %.03f,
( $now - ( stat( ${hdir}${file} ) )[9] ) / 86400;
printf %.03f,
( $now - (
Hi Derek,
sprintf (%.03f,($now - (stat(${hdir}${file}))[9])/86400);
sprintf prints to a string, so you need to assign its return value to
something... or print it... or simply switch to printf.
my $value = sprintf( ... );
print $value;
or
print sprintf( ... );
or
printf( ... );
Damn
I apologize if this appears twice. I posted it once and did not see it
appear (after waiting a few hours) in the list so I'm posting it again.
I'm looking at the source code for queue.pm and I'm quite surprised at how
short it is. I have some questions about the syntax:
(1) What does
64 matches
Mail list logo