Hi,I have this code:
#!perl -w
$x = 0;
use Win32::EventLog;
$handle=Win32::EventLog->new("Application")
or die "Can't open Application EventLog\n";
$handle->GetNumber($recs)
or die "Can't get number of EventLog records\n";
print "No. of records = $recs\n";
$handle->GetOldest($b
the whole point to setting a shebang is so you *dont* have to type
/foo/bar/yada/quux/some/more/blah/perl
you can, if on *nix (DOSneyland will ignore the shebang), say:
./script
now, if you're in DOSneyland, like mentioned above, setting the shebang has
little effect, other then switches passed
Heya Rajanikanth,
It looks like the man page (perldoc Storable) gives a good description
of what dclone does:
__QUOTE__
MEMORY STORE
The Storable engine can also store data into a Perl scalar
instead, to later retrieve them. This is mainly used to
freeze a complex structure
Does any body know why the printf is not printing anything out!
I tested the rest of the script by replacing the printf line with,
##
print "$line";
##
the file prints (with out any changes to the file, as expected). So
everything else is working apart from the printf.
Any help w
On Thu, Jul 12, 2001 at 09:52:32AM +0100, Govinderjit Dhinsa wrote:
> Does any body know why the printf is not printing anything out!
>
> I tested the rest of the script by replacing the printf line with,
> ##
> print "$line";
> ##
> the file prints (with out any changes to the fi
At 09:52 12.07.2001 +0100, Govinderjit Dhinsa wrote:
>Does any body know why the printf is not printing anything out!
>
>I tested the rest of the script by replacing the printf line with,
>##
>print "$line";
>##
>the file prints (with out any changes to the file, as expected). So
>
Hello all,
I'm looking for a perl function allowing to copy or to move a file from a
directory to another one.
Any suggestion?
Thanks.
Try File::Copy::copy source.file dest.file.
File::Copy package is in the standard perl.
On Thursday 12 July 2001 02:59 pm, you wrote:
> Hello all,
>
> I'm looking for a perl function allowing to copy or to move a file from a
> directory to another one.
> Any suggestion?
>
> Thanks.
A bit off the topic but does anyone know how to or even if it is possible to
auto run the A drive (Stiffy discs).
TIA
Justin
what os ?
windows ?
- Original Message -
From: "justin todd" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 8:46 AM
Subject: A Drive
> A bit off the topic but does anyone know how to or even if it is possible
to
> auto run the A drive (Stiffy discs).
>
> TIA
Jos wrote:
> the whole point to setting a shebang is so you *dont* have to type
> /foo/bar/yada/quux/some/more/blah/perl
There is another imporant reason to set the shebang...CGI.
> you can, if on *nix (DOSneyland will ignore the shebang), say:
> /script
You can do this, but make sure you have
Hi anyone,
I have downloaded some modules from CPAN into my local
directory.
I am on a DEC alpha machine with no root permissions.
How do I install modules into my local directory?
I was trying to install LWP,HTTP modules.
thank you in advance.
Giri
__
On Thu, Jul 12, 2001 at 04:54:47AM -0700, Giridhar nandikotkur wrote:
> I have downloaded some modules from CPAN into my local
> directory.
>
> I am on a DEC alpha machine with no root permissions.
> How do I install modules into my local directory?
> I was trying to install LWP,HTTP modules.
T
Hi everybody!
I want to call a external C-Programm with a parameter and a returnvalue
from my perlprogramm.
Could somebody help me ?
Thanks a lot
Jürgen
--
GAMED mbH
Harter Straße 48
A-8053 Graz
Austria
Phone: +43 (0)316 27 86 60-16
Fax: +43 (0)316 27 86 60-10
EMail: [EMAIL PROTECTED]
Hi everybody!
I want to call a external C-Programm with a parameter and a returnvalue
from my perlprogramm.
Could somebody help me ?
Thanks a lot
Jürgen
--
GAMED mbH
Harter Straße 48
A-8053 Graz
Austria
Phone: +43 (0)316 27 86 60-16
Fax: +43 (0)316 27 86 60-10
EMail: [EMAIL PROTECTED]
I sometimes hear there is a compiler avalaible which produces win32exes out
of perl scripts ...
Has anybody further information ??
thx
Stefan Oswald
Perl2Exe will do this for you, at he cost of performace of course
http://www.indigostar.com/perl2exe.htm
Stefan Oswald wrote:
>
> I sometimes hear there is a compiler avalaible which produces win32exes out
> of perl scripts ...
> Has anybody further information ??
>
> thx
>
> Stefan Oswald
system call as the quickest solution, however I'm sure someone in this
group knows of a perl module that might do this better?
$rv = `cprog @args`;
Jürgen Prietl wrote:
>
> Hi everybody!
>
> I want to call a external C-Programm with a parameter and a returnvalue
> from my perlprogramm.
> Could
You can embed your C in perl using XS.
perldoc perlxstut
is an excellent place to start!
-Original Message-
From: Akshay Arora [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 8:15 AM
To: Jürgen Prietl
Cc: [EMAIL PROTECTED]
Subject: Re: How could I call a C-Programm
system cal
my $returnCode=defined($cmd) ? system($cmd." ".join(" ",sort @hitList)) : 0;
> Hi everybody!
hello dr Juergen!
> I want to call a external C-Programm with a parameter and a returnvalue
> from my perlprogramm.
you can actually use C in your perl code if you use the Inline module ingy
wrote...
here's the link to CPAN, maybe it will help you
http://search.cpan.org/search?
If you can't install Net::FTP, the following works with the ftp.exe
program on NT to get the file /tmp/frazzle in binary mode:
open FTP, "> tmpftp.$$";
print FTP < On Wed, Jul 11, 2001 at 10:20:58AM -0700, [EMAIL PROTECTED] wrote:
> > I have to automate ftp process using perl or shell scripts. At
Stefan Oswald wrote:
>
> I sometimes hear there is a compiler avalaible which produces win32exes out
> of perl scripts ...
> Has anybody further information ??
>
I think that the perl script is converted to a bat file , and is loaded
as such .
Anybody cares to correct me on this .
Regards Pete
--- "FIEDRICH,JAMIE (HP-USA,ex1)" <[EMAIL PROTECTED]> wrote:
> I have a text file in which I want to find a specific string - call
> it a heading. Once I've found the string (heading), I want to stuff
> the next line (content) into a variable.
>
> What is the most effective way to do this?
Mos
I try to write a program that reads a file with two fields.The first field is a
costumer ID and the second is the costumer name by using " ! " as a seperator between
2 fields. Store costumer ID as the key and the costumer name as value into a hash.
My code is below, I have a problem that $info{
I try to write a program that reads a file with two fields.The first field is a
costumer ID and the second is the costumer name by using " ! " as a seperator between
2 fields. Store costumer ID as the key and the costumer name as value into a hash.
My code is below, I have a problem that $inf
Ah -- of course.
you need to chomp your $key when you read from STDIN.
-Original Message-
From: jatuporn [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 9:54 AM
To: [EMAIL PROTECTED]
Subject: Problem with associative array
I try to write a program that reads a file with two fi
On Jul 12, jatuporn said:
>I try to write a program that reads a file with two fields.The first
>field is a costumer ID and the second is the costumer name by using " !
>" as a seperator between 2 fields. Store costumer ID as the key and the
>costumer name as value into a hash.
>
>My code is belo
In Visual I used the MID function to get a part of a text... por ex. "price
= 33.10" and I could get using "=" and EOL as delimiters the price "33.10"
Can you tell me if I should use the SPLIT function in perl???
Thanks...
Seba.
--- jatuporn <[EMAIL PROTECTED]> wrote:
> I try to write a program that reads a file with two fields.The first
> field is a costumer ID and the second is the costumer name by using "
> ! " as a seperator between 2 fields. Store costumer ID as the key and
> the costumer name as value into a hash.
Here's a topic for discussion:
Coming from C++-land, I've always been taught over and over again that all
subroutines/functions/blocks/etc should have only a single entry point and
a single exit point. "It's just good programming practice." But now in
the world of Perl, I've observed that a
I'm reading the chapter on Subroutines in the camel book and have a question
about the prototypes described on page 226.
At first my understanding was, there should be a $ or @ for each parameter
expected. Or a \@ or \$ for each reference expected. But one of the
examples reads:
sub mysplice (\
Kurt Edmiston said:
> Coming from C++-land, I've always been taught over and over again
> that all subroutines/functions/blocks/etc should have only a single
> entry point and a single exit point.
Works great in theory ;) Especially if you have exceptions.
It's just not practicle/readable to alw
On Jul 12, Kurt Edmiston said:
>Coming from C++-land, I've always been taught over and over again that all
>subroutines/functions/blocks/etc should have only a single entry point and
>a single exit point. "It's just good programming practice." But now in
>the world of Perl, I've observed tha
At 11:28 12.07.2001 -0400, Kurt Edmiston wrote:
>Here's a topic for discussion:
>
>Coming from C++-land, I've always been taught over and over again that all
>subroutines/functions/blocks/etc should have only a single entry point and
>a single exit point. "It's just good programming practice."
Hello all, I came across this problem opening up files that are fed in
from command line using "ls". I do not know why this script did not
work. Appreciated any input.
#!/usr/local/bin/perl
# I am trying to feed all the files in this directory to do text
processing and save the processed txt i
You could use something like this
$string = "price= 33.10";
($number) = $string =~ /=\s+(.*)$/;
print $number;
-Original Message-
From: Sebadamus [mailto:[EMAIL PROTECTED]]
Sent: 12 July 2001 16:24
To: [EMAIL PROTECTED]
Subject: MID in Visual Basic...
In Visual I used the MID functio
Hello Jennifer,
Thursday, July 12, 2001, Jennifer Pan <[EMAIL PROTECTED]> wrote:
JP> Hello all, I came across this problem opening up files that are fed in
JP> from command line using "ls". I do not know why this script did not
JP> work. Appreciated any input.
[...]
JP> at prompt I typed
JP>
Here is one way:
open X, ">>output.txt";
while (<>) {
s/^\s*//;
print X "$_";
}
close X;
Since it looks like you are coming from unix environment, you could do:
format.pl *.txt
which will read in all files one after the other automatically. Now if you
want some breakout, then
In your die command, say:
die "cannot open $LINE: $!\n";
This will give you a hint as to what's going wrong.
-Original Message-
From: Maxim Berlin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 11:51 AM
To: [EMAIL PROTECTED]
Subject: Re: open FILE problem
Hello Jennifer,
Th
On Jul 12, Vincent said:
>I'm reading the chapter on Subroutines in the camel book and have a question
>about the prototypes described on page 226.
>At first my understanding was, there should be a $ or @ for each parameter
>expected. Or a \@ or \$ for each reference expected. But one of the
>e
ls format is OS dependant. On Solaris ls returns a multiple column list, so the first
line would be multiple filenames.
Chris D. Garringer
LAN/WAN Manager
Master Certified Netware Engineer
Microsoft Certified Systems Engineer
Certified Solaris Administrator
Red Hat Certified Engineer
[EMAIL PROT
NAME
beginners-faq - FAQ for the beginners mailing list
1 - Administriva
1.1 - I'm not subscribed - how do I subscribe?
Send mail to <[EMAIL PROTECTED]>
You can also specify your subscription email address by sending email to
(assuming [EMAIL PROTECTED] is your email address)
--- Kurt Edmiston <[EMAIL PROTECTED]> wrote:
> Here's a topic for discussion:
And a good one. =o)
> Coming from C++-land, I've always been taught over and over again
> that all subroutines/functions/blocks/etc should have only a single
> entry point and a single exit point. "It's just good pr
Excellent!
Thank you all for your help!
I am going to spend more time on man pages or beginners book.
What is the best beginners book in you opinion?
Thank you very much!
On Wed, 11 Jul 2001 12:07:47 -0400
"Stephen P. Potter" <[EMAIL PROTECTED]> wrote:
> Lightning flashed, thunder crashed
--- Jennifer Pan <[EMAIL PROTECTED]> wrote:
> Hello all, I came across this problem opening up files that are fed
> in from command line using "ls". I do not know why this script did
not
> work. Appreciated any input.
>
> #!/usr/local/bin/perl
>
> # I am trying to feed all the files in this d
Hi all
Just to confirm some thoughts I had...
Since double quotes need to be searched for variable interpolation,
while single quotes don't, I should always (whenever possible) prefer
single quotes instead of double quotes in my programs, because:
print 'hi all';
would be faster than
print "h
Heya I.S,
I think we need to be a bit more specific. You're not giving us any
information (even wrong information) about how you connect to the
database. We don't know for sure whether you're passing the right
arguments. I am going to assume you're using MySQL, as it's a common
database engine
susbtr is almost identical to mid, but better (isn't that true for most of
perl?)
perldoc -f susbtr
- Original Message -
From: "Sebadamus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 9:24 AM
Subject: MID in Visual Basic...
> In Visual I used the MID functi
Ack! Typo!
substr
- Original Message -
From: "Ken" <[EMAIL PROTECTED]>
To: "Sebadamus" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 12:18 PM
Subject: Re: MID in Visual Basic...
> susbtr is almost identical to mid, but better (isn't that true for most of
> per
"Sebadamus" <[EMAIL PROTECTED]> wrote:
>In Visual I used the MID function to get a part of a text... por ex. "price
>= 33.10" and I could get using "=" and EOL as delimiters the price "33.10"
this might work:
$line =~ /=\s(.+)\n/s and $price = $1;
where $line is your part of text and $price is
--- Silvio Luis Leite Santana <[EMAIL PROTECTED]> wrote:
> Since double quotes need to be searched for variable interpolation,
> while single quotes don't, I should always (whenever possible) prefer
> single quotes instead of double quotes in my programs, because:
>
> print 'hi all';
>
> would
--- Ken <[EMAIL PROTECTED]> wrote:
> susbtr is almost identical to mid, but better (isn't that true for
> most of perl?)
> perldoc -f susbtr
lol -- I think so.
Compare "use strict" with "Option Explicit". =o)
Anyway
> - Original Message -
> From: "Sebadamus" <[EMAIL PROTECTED]>
> T
Hello Silvio,
Thursday, July 12, 2001, Silvio Luis Leite Santana <[EMAIL PROTECTED]> wrote:
SLLS> Just to confirm some thoughts I had...
SLLS> Since double quotes need to be searched for variable interpolation,
SLLS> while single quotes don't, I should always (whenever possible) prefer
SLLS> si
Hello Silvio,
Thursday, July 12, 2001, Silvio Luis Leite Santana <[EMAIL PROTECTED]> wrote:
SLLS> Just to confirm some thoughts I had...
SLLS> Since double quotes need to be searched for variable interpolation,
SLLS> while single quotes don't, I should always (whenever possible) prefer
SLLS> si
C.J,
I am able to connect successfully to the sybase SQL server.
$dbh = DBI->connect("dbi:Sybase:server=$server;loginTimeout=240", $userID, $pass)
my problem is that eventhough I have set a timeout parameter I still get that message
pretty regularly!!! I set it to a higher value and still the s
Active State has an exe-maker in their Dev Kit. I had problems with
Perl2Exe, but that was probably because of my inexperience with it. I did
find that their support help (at Perl2Exe) was very lacking.
-Original Message-
From: pete [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2
On Jul 12 2001, Kurt Edmiston wrote:
> I guess I'm just curious to know what other more experienced Perl
> programmers think about this. I still adhere strictly to the "one way in,
> one way out" philosophy, mainly for the sake of readability. But I
> understand how much easier it can make a
On Thu, 12 Jul 2001, Rogério Brito wrote:
On Jul 12 2001, Kurt Edmiston wrote:
> I guess I'm just curious to know what other more experienced Perl
> programmers think about this. I still adhere strictly to the "one way
> in, one way out" philosophy, mainly for the sake of readability. But
> I u
Personally, i am very liberal with my lasts/breaks/returns/gotos.
There is definitely something to be said for strictness. From a theoretical
point of view, the code flows better. For example, it is easier to diagram
and easier to debug. If i write code for the company i work for, i follow
the
How would I do this:
file A contains a line of characters always looking like "hostname X".
I want to take the X and assign that to a scalar...I tried making an
array out of it by using grep to search for the line starting with
"hostname", but then the one and only element of the array
If i understand you correctly, you're trying to extract exactly one line out
of a file.
I would do this:
while ()
{
if (/^hostname\s+(\S+)$/) # or some other regex derivative
{
$hostname=$1;
last;
}
}
-Original Message-
From: Gross
7.12.2001
Dear Sirs,
I have been using an html form for gathering information to use in order to
give customers quotes on our products. I have the fields validated on the
clients browser (javascript) before submission to the server. The form is
then parsed by formmail.pl, a script the host prov
Reading the entire file into an array is rarely a good idea, but if you
insist on doing it, then you have to realize that each element of the array
is going to be exactly one line of the file. So, "hostname X\n" is
going to be one element unless you explicitly extract using a split or
regex.
Hello all,
I stdin a file name: xxx.txt
and I would like to have a output file name called x.txt.yyy
This is how I do it
$FILENAME = ;
$output = "$FILENAME.y";
print "$output";
And the result is only
.yyy
How do I concatenate $FILENAME and .yyy?
Thank you
make like pacman and CHOMP IT !!! ;)
$FILENAME = ;
chomp $FILENAME;
...
-Original Message-
From: Jennifer Pan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 3:49 PM
To: [EMAIL PROTECTED]
Subject: concatenate $FILENAME and .yyy
Hello all,
I stdin a file name: xxx.txt
and I w
you posted some code that said:
if ($ENV{'REQUEST_METHOD') eq 'GET') {
@pairs = split (/&/,
$ENV{'QUERY_STRING'});
} elsif ($ENV{'REQUEST_METHOD'} eg
'POST') {
**
did you mean:
if ($ENV{'REQUEST_METHOD') eq 'GET') {
@pairs = split (/&/,
$ENV{'QUERY_STRING'});
} elsif ($
"Grossner, Tim X. (AIT)" wrote:
> How would I do this:
>
> file A contains a line of characters always looking like "hostname X".
> I want to take the X and assign that to a scalar...I tried making an
> array out of it by using grep to search for the line starting with
> "hostname", but t
Jennifer Pan wrote:
> Hello all,
>
> I stdin a file name: xxx.txt
> and I would like to have a output file name called x.txt.yyy
>
> This is how I do it
>
> $FILENAME = ;
> $output = "$FILENAME.y";
> print "$output";
>
> And the result is only
> .yyy
>
> How do I concatenate $FILENAME and .yyy?
>
Didn't you say you wanted the file to be named x.txt.yyy?
how about?
$filename = "xxx.txt";
$output = "xxx.txt" . ".yyy";
$output =~ s/xxx/x/;
print $output;
Craig
[EMAIL PROTECTED]
Pager
Numeric: 1-877-895-3558
Email pager: [EMAIL PROTECTED]
---
I forgot the beginning in my example:
$filename = ;
chomp($filename);
$output = "$filename" . ".yyy";
$output =~ s/xxx/x/;
print $output;
Craig
[EMAIL PROTECTED]
Pager
Numeric: 1-877-895-3558
Email pager: [EMAIL PROTECTED]
--
You will
On Thu, Jul 12, 2001 at 02:39:34PM -0600, Customer Service wrote:
> I have been using an html form for gathering information to use in order to
> give customers quotes on our products. I have the fields validated on the
> clients browser (javascript) before submission to the server.
While valid
--- Jennifer Pan <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I stdin a file name: xxx.txt
> and I would like to have a output file name called x.txt.yyy
>
> This is how I do it
>
> $FILENAME = ;
> $output = "$FILENAME.y";
> print "$output";
I suspect the problem in the newline you get from
--- "Grossner, Tim X. (AIT)" <[EMAIL PROTECTED]> wrote:
> How would I do this:
>
> file A contains a line of characters always looking like "hostname
> X".
> I want to take the X and assign that to a scalar...I tried making
> an
> array out of it by using grep to search for the line sta
I need to know if my browsers are sending IMS calls to the web server to
fetch html, images, etc. Is Perl able to watch the data returned to the
browser and tell me if IMS calls occurred?
Lightning flashed, thunder crashed and EriK W <[EMAIL PROTECTED]> whispered:
| Excellent!
|
| Thank you all for your help!
|
| I am going to spend more time on man pages or beginners book.
|
| What is the best beginners book in you opinion?
Currently, I like "A Little Book on Perl" by Robert S
Hi Kurt,
Actually , it's quite common to have multiple entry and exit points.
Even in C++ if you write Object Code ... your constructors can
be overriden (different entry points ) and any method can exit
anywhere ... If you've only used C++ to code procedural style
this would lead you
Hi, this is my first post, so don't blame me (too much) if i'm posting to
the wrong list.
I'm working on a very simple client/server program in Perl... A server
broadcasts udp packets with some info that a couple of clients then
collect & display.
Well, could anyone tell me what's the mistake in t
--Papo Napolitano <[EMAIL PROTECTED]> [010712 21:37]:
> Hi, this is my first post, so don't blame me (too much) if i'm posting to
> the wrong list.
> I'm working on a very simple client/server program in Perl... A server
> broadcasts udp packets with some info that a couple of clients then
> colle
Thanks for your help.
I can call a c-programm with the statement $rv = `cprog @args` but i don't
get a returnvalue.
Do you know, why ?
Akshay Arora wrote:
> system call as the quickest solution, however I'm sure someone in this
> group knows of a perl module that might do this better?
>
> $rv =
80 matches
Mail list logo