Check out ActiveState's PerlApp that comes with their Perl Dev Kit.
It does a very good job of packaging your Perl scripts in a compressed
executable that will extract and then run the script without Perl having to be
installed on the target machine.
There is also a product called perl2exe which
Hello,
I'm looking for a link where i can find information about Perl's best practices
programming.
Thanks in advance.
===
José Nyimi Mbambi
IT Analyst
http://www.proximus.be
DISCLAIMER
"This e-mail and any attachment thereto may contain information which is c
Here are some best practices i know:
1. use warnings or -w
2. use strict;
Could you extends the list please ?
José.
-Original Message-
From: NYIMI Jose (BMB)
Sent: Tuesday, June 24, 2003 8:58 AM
To: [EMAIL PROTECTED]
Subject: Perl Best Practices
Hello,
I'm looking for a link where
On Tue, Jun 24, 2003 at 09:17:10AM +0200, NYIMI Jose (BMB) wrote:
> Here are some best practices i know:
> 1. use warnings or -w
> 2. use strict;
>
> Could you extends the list please ?
Those are probably the most important. :-)
And from the making-best-use-of-available-resources dept:
3. us
Hello,
I'd appreciate any suggestions on how to calculate Disk space and Free
Space.
Many Thanks
Denham Eva
Oracle DBA
Linux like TeePee... No Windows, No Gates and Apache inside!
_
This e-mail message has been
Sherwin Remo wrote at Tue, 24 Jun 2003 06:56:40 +0800:
> I would like to write a script that would check the correct syntax of an XML
> file. Need to check if the file is XML compliant. Is there a module that I
> can use to do this? Thanks!
There are a lot of XML modules on CPAN:
http://search
I'm on the first few chapters of "Learning Perl" and came up with a
question. Given:
-
@array = qw ( one two three );
print @array . "\n";
print @array;
-
Why does the first print statement print "3" (and a carriage return)
Hi.
I'm a new Perl programmer and CPAN user.
Here's my problem:
When I try to use CPAN to fetch something, all the normal mechanisms
time out, and then I get down to ncftpget, which works.
I'm not behind a firewall, so I would have thought that LWP would work
(as a matter of fact, I've written
Nyimi Jose wrote:
Hello,
I'm looking for a link where i can find information about Perl's best practices programming.
For starters you can take a look at these docs
perldoc perlstyle
perldoc perltrap
perldoc perlmodstyle #If you are interested in developing modules
Thanks in advance.
==
Because in the first statement @array is used in scalar context so it's like you wrote
something as
[EMAIL PROTECTED];
print $size."\n";
That's why you get the number of items contained in @array which is 3.
HTH,
José.
-Original Message-
From: Peter [mailto:[EMAIL PROTECTED]
Sent: Tue
Hello,
There are a lot of perl modules dealing with the XML.
The most common is XML::Parser which will surely do whatever you want and
perhaps a litle more.
XML::Simple is also very useful for Simple XML treatment.
Just go to CPAN web site.
Michel
-Message d'origine-
De: Remo, Sherwi
I'm reading an Excel .csv file.
Fields are separated by commas.
If a field contains a comma, the whole field is double-quoted (Excel does
this by default).
An example of an input line is as follows:
field1,field2,"field3a, field3b, field3c",field4,"field5a, field5c",field6
I want to get each fiel
Sparrow, Dave wrote:
I'm reading an Excel .csv file.
Fields are separated by commas.
If a field contains a comma, the whole field is double-quoted (Excel does
this by default).
An example of an input line is as follows:
field1,field2,"field3a, field3b, field3c",field4,"field5a, field5c",field6
Hi
I am writing a perl scipt in that I want to change the dir to some other and run a exe
from there is it possible?
Because chdir is not working there.
Thanks and Regards
-Gayatri
- Original Message -
From: Sparrow, Dave
To: [EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 3:46
Gayatri wrote:
Hi
Please start a new thread to ask a question
I am writing a perl scipt in that I want to change the dir to some other and run a exe from there is it possible?
Yes it is possible, it is also possible to do that without changing to
that directory
Because chdir is not working t
you can get modules from cpan.perl.org
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
Confidential: This electronic message and all contents contain information
from Syntel, Inc. whi
On Tue, 24 Jun 2003, Sparrow, Dave wrote:
> I'm reading an Excel .csv file.
> Fields are separated by commas.
> If a field contains a comma, the whole field is double-quoted (Excel does
> this by default).
> An example of an input line is as follows:
>
> field1,field2,"field3a, field3b, field3c
Gayatri wrote:
Please reply to the list
thanks for ur suggetions
I am sorry u told me to start new thread.
i donot know how to start in a new thread.
Just address your email with the question to [EMAIL PROTECTED]
I didnot mean chdir() is not working.
I am not able to run the file from that d
Thanks I got a solution.
I was doing a silly mistake.
chdir I was executing thro' system command like cd.
Now it works.
thanks for solutions
Thanks and Regards
-Gayatri
DISCLAIMER**
This e-mail and any attachment is for authorised u
From: Denham Eva <[EMAIL PROTECTED]>
> I'd appreciate any suggestions on how to calculate Disk space and Free
> Space.
use Win32::FileOp;
($free_for_user, $total_space, $total_free) = GetDiskFreeSpace('C:');
You may install Win32::FileOp with PPM from
http://Jenda.Krynicky.cz/perl
c:\> ppm
ppm>
From: "Dave Mamanakis" <[EMAIL PROTECTED]>
> I have a perl program that I need to be able to run on all kinds of
> machines. However, I cannot install perl on each of these machines. It
> has to be run locally, not over a network (too many issues with
> security) How can this be done? I know with s
Hi All
On receiving no reply to my previous post, I myself struggled a bit and came
up with the following code to login to the site :
--
use LWP::UserAgent;
use HTTP::Cookies;
$ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->
This works great, except when I do:
for (keys %codes_hash) {
print "$_|$codes_hash{$_}\n";
}
for my own confirmation, I'm getting a blank line in the printout. I
re-checked my config file and made sure there was not an extra blank
line at the end of the file. Do you have any ideas why it woul
Tim McGeary wrote:
This works great, except when I do:
for (keys %codes_hash) {
print "$_|$codes_hash{$_}\n";
}
for my own confirmation, I'm getting a blank line in the printout. I
re-checked my config file and made sure there was not an extra blank
line at the end of the file. Do you have
> This works great, except when I do:
>
> for (keys %codes_hash) {
> print "$_|$codes_hash{$_}\n";
> }
>
> for my own confirmation, I'm getting a blank line in the
> printout. I re-checked my config file and made sure there
> was not an extra blank line at the end of the file. Do you
>
Hi all,
In comp.unix.shell Alan Murrell posted this clever sed solution for removing
entries from his named.conf file using only the domain name):
sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile
Instead of using actual line numbers for the range of lines (such as "1,4")
he uses two
Maybe consider:
use diagnostics;
as well, at least while you are developing your code.
Thanks! :-)
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
>
-Original Me
Kevin Pfeiffer said:
> In comp.unix.shell Alan Murrell posted this clever sed solution for
> removing entries from his named.conf file using only the domain name):
>
> sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile
>
> Instead of using actual line numbers for the range of lines (such
Dan Muey said:
>> my %codes_hash = ();
>
> Change this to my %codes_hash;
> the = () is adding an empty key/value
Are you sure?
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Yah - that didn't work. It still would have needed the chomp;
Tim
Paul Johnson wrote:
Dan Muey said:
my %codes_hash = ();
Change this to my %codes_hash;
the = () is adding an empty key/value
Are you sure?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMA
> Hi all,
Howdy,
>
> In comp.unix.shell Alan Murrell posted this clever sed
> solution for removing
> entries from his named.conf file using only the domain name):
>
> sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile
>
> Instead of using actual line numbers for the range of lines
> > sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile
> >
> > Instead of using actual line numbers for the range of lines (such as
> > "1,4") he uses two regexes that match to them.
> >
> > How might one do this in Perl?
>
> Just the same way:
>
> perl -ne 'print unless /zone "domain.co
> Take a look at Text::CSV or Text::CSV_XS
Ah, but here's the kicker...
Most people who I will give this script to will be running Perl 5.6 and WILL
NOT have the ability to use any external modules, even those such as 'use
strict' !
This is because they will be running a cut-down version of Perl th
> Yah - that didn't work. It still would have needed the chomp;
>
Then it must be getting added from the a blank line (IE ^\n$ or somilar) in the file.
> Tim
>
> Paul Johnson wrote:
> > Dan Muey said:
> >
> >
> >>>my %codes_hash = ();
> >>
> >>Change this to my %codes_hash;
> >>the = () is
> Dan Muey said:
>
> >> my %codes_hash = ();
> >
> > Change this to my %codes_hash;
> > the = () is adding an empty key/value
>
> Are you sure?
I assumed (I know I know one shouldn't assume ;p) that since I've had the same issue
and once I changed
my %hash = (); to my %hash; the empty key/valu
In article <[EMAIL PROTECTED]>, Paul
Johnson wrote:
>
> Kevin Pfeiffer said:
>
>> In comp.unix.shell Alan Murrell posted this clever sed solution for
>> removing entries from his named.conf file using only the domain name):
>>
>> sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile
>>
>>
I have two web sites with about 300 htm and php files. I wish to make a change so tht
the database connect string in all of these files is changed for mysql_pconnect to
mysql_connect. Can perl do this and if so can anyone show me how?
Ideally I would like to feed a script or command line with a
This worked great. I had to tweak it a *little* bit because I'm
after a slightly different thing, but I am now happily printing data from
the client to STDOUT (and understanding how that works, too).
BTW, this TCP/IP server is a test tool for some brokerage software.
A few more
cd /whatever dir
perl -i.bak -pe's/\bmysql_pconnect\b/mysql_connect/g' *
If everything is OK, delete the *.bak files.
Luke
> -Original Message-
> From: Peter Goggin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2003 8:08 AM
> To: [EMAIL PROTECTED]
> Subject: Use of Perl for global
In article <[EMAIL PROTECTED]>, Dave Sparrow
wrote:
>> Take a look at Text::CSV or Text::CSV_XS
> Ah, but here's the kicker...
> Most people who I will give this script to will be running Perl 5.6 and
> WILL NOT have the ability to use any external modules, even those such as
> 'use strict' !
> T
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):
You want Win32::DriveInfo
> -Original Message-
> From: Denham Eva [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2003 12:42 AM
> To: BeginnersPerl (E-mail); Perl-Beginner (E-mail)
> Subject: Calculating Disk Space and Freespace on Windows
>
>
> Hello,
>
> I'd appreciate any sugges
> I have two web sites with about 300 htm and php files. I wish
> to make a change so tht the database connect string in all of
> these files is changed for mysql_pconnect to mysql_connect.
> Can perl do this and if so can anyone show me how?
>
> Ideally I would like to feed a script or comma
Hello,
I have to get the size and last modified date of a remote file via URL without
reading in the whole file. I have gone through LWP::UserAgent but couldn't make much
headway. Any pointers on how to do it would be appreciated.
TIA
Shishir
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
F
Hi,
I have sort of a strange problem, and if anyone has a fix for it, please let
me know. I don't know if this is perl-related or my software package.
I am using 'Reflection X' for telneting. It's a great communications
package, witht he exception of one annoying nuance. When I am debugging a
On Mon, Jun 23, 2003 at 09:14:25PM +0200, [EMAIL PROTECTED] wrote:
> hi, how can i use a real regex with this:
>
> File::Find::name if -x?
>
> the filetestops are working fine, but how can i filter things like
> .gz$? i tried many ways, but all failed. any idea? thanks!!
>
> bye andreas
Andreas
Hello,
I have to get the size and last modified date of a remote file via URL without
reading in the whole file. I have gone through LWP::UserAgent but couldn't make much
headway. Any pointers on how to do it would be appreciated.
TIA
Shishir
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
F
Hi...
My TCP/IP server is printing input fine, now I'm trying to send the
right output.
The client for my server expects an EndOfLine character that is a hex
0D0A. (zero-dee-zero-ay) My code is doing this:
my $eol = "\x{0D0A}";
but the client is seeing this:
E0B4 8A
An
HI all.
I have what appears to be a C++ file set (i.e. phone.dat, phone.idx).
My question is can Perl read these files and what modules do I need to do
it.
Any starting help would be great.
Thankx
Ned Cunningham
POS Systems Developer
Monro Muffler Brake & Service
200 Holleder Parkway
Rocheste
From: "Shishir K. Singh" <[EMAIL PROTECTED]>
> I have to get the size and last modified date of a remote file via
> URL without reading in the whole file. I have gone through
> LWP::UserAgent but couldn't make much headway. Any pointers on how to
> do it would be appreciated.
Try to use HEAD re
I'm doing a "simple" form using Tk. Things are going well, but I feel a
little lazy, so for once I will ask about this.
Perl/Tk script is running on linux box "host". Users are on windows
boxes "local", running the application via an X server (Hummingbird
Exceed) and the "export DISPLAY" command.
> From: "Shishir K. Singh" <[EMAIL PROTECTED]>
> > I have to get the size and last modified date of a remote file via
> > URL without reading in the whole file. I have gone through
> > LWP::UserAgent but couldn't make much headway. Any
> pointers on how to
> > do it would be appreciated.
>
Howdy List!
I'm writing a simple module to return a few variables and functions.
The perldoc perlmod* stuff says I should use Carp; and call that instead of warn().
So..
1)
If I use Carp shoud I still use warnings; in the package?
2)
If I understand it correctly the preffered way would be to do:
CGI's remote_user()
rturns $ENV{'REMOTE_USER'};
While
sub user_name {
my ($self) = self_or_CGI(@_);
return $self->http('from') || $ENV{'REMOTE_IDENT'} || $ENV{'REMOTE_USER'};
}
SO if I'm trying to get the login name I should use user_name since it will return
REMOTE_USER or REMOTE_IDENT
Answering my own question:
my $eol = "\r\n";
\r\n becomes 0D0A.
-C
-Original Message-
From: McMahon, Christopher x66156
Sent: Tuesday, June 24, 2003 10:35 AM
To: '[EMAIL PROTECTED]'
Subject: help sending hex EOL chars
Hi...
My TCP/IP server is printing input fine, now
From: "Dan Muey" <[EMAIL PROTECTED]>
> I'm writing a simple module to return a few variables and functions.
>
> The perldoc perlmod* stuff says I should use Carp; and call that
> instead of warn(). So.. 1) If I use Carp shoud I still use warnings;
> in the package?
Definitely. "use Carp" and "us
Gayatri wrote:
>
> Thanks I got a solution.
Please reply in the original thread that you started.
> I was doing a silly mistake.
> chdir I was executing thro' system command like cd.
When you do that system creates a new process and any changes you make
in that process do not affect your curren
On Tue, Jun 24, 2003 at 01:52:20PM -0500 Dan Muey wrote:
> I'm writing a simple module to return a few variables and functions.
>
> The perldoc perlmod* stuff says I should use Carp; and call that
> instead of warn().
> So..
> 1)
> If I use Carp shoud I still use warnings; in the package?
Those
In article <[EMAIL PROTECTED]>,
Christopher X66156 McMahon wrote:
[top post moved down]
>> -Original Message-
>> From: McMahon, Christopher x66156
>> Sent: Tuesday, June 24, 2003 10:35 AM
>> To: '[EMAIL PROTECTED]'
>> Subject: help sending hex EOL chars
>>
>>
>> Hi...
>> My TCP/IP s
Excellent, Thanks Jenda and Tassilo
Yeah I did mean qw() instead of () oops.
Thanks for the info, I think I will just use Carp; and take your
wisdom and apply it's functions appropriately
Thanks again!
What a great list!!!
Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm
Ned Cunningham wrote:
>
> HI all.
Hello,
> I have what appears to be a C++ file set (i.e. phone.dat, phone.idx).
That looks like a database file set. The file command should tell you
what they are:
$ file phone.dat phone.idx
> My question is can Perl read these files and what modules do I ne
> CGI's remote_user()
> rturns $ENV{'REMOTE_USER'};
> While
> sub user_name {
> my ($self) = self_or_CGI(@_);
> return $self->http('from') || $ENV{'REMOTE_IDENT'} ||
> $ENV{'REMOTE_USER'}; }
>
> SO if I'm trying to get the login name I should use user_name
> since it will return REMOTE_
On Jun 24, Kevin Pfeiffer said:
>>> sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile
>>>
>>> How might one do this in Perl?
>>
>> perl -ne 'print unless /zone "domain.com" {/ .. /};/' \
>> /etc/named.conf > newfile
>
>Cool, I didn't think of Perl's range operator "..".
Don't be foo
Suppose I have a module:
package MyConfig;
use strict;
use warnings;
use CGI qw(:standard); # or user_name or one then other if fail?
use DBI;
use base 'Exporter';
use Carp;
Now in the script I have
#!/usr/bin/perl
use MyConfig;
..
Will use strict and warnings still be in effect for t
From: "Dan Muey" <[EMAIL PROTECTED]>
> Suppose I have a module:
>
> package MyConfig;
>
> use strict;
> use warnings;
>
> use CGI qw(:standard); # or user_name or one then other if fail?
> use DBI;
>
> use base 'Exporter';
> use Carp;
>
>
> Now in the script I have
>
> #!/usr/bin/perl
>
Cool, Thanks again Jenda, it's coming slowly, bit by bit.
Have a good one!
> From: "Dan Muey" <[EMAIL PROTECTED]>
> > Suppose I have a module:
> >
> > package MyConfig;
> >
> > use strict;
> > use warnings;
> >
> > use CGI qw(:standard); # or user_name or one then other if
> fail? use
> > DB
Sorry John,
wasn't watching where I was sending the reply...
-Original Message-
From: Derek Byrne
Sent: 24 June 2003 21:40
To: 'John W. Krahn'
Subject: RE: Binary file conversion
best thing is to try opening them with notepad (if you got windows 9x/NT).
dat files are usually text file
Hi,
I am trying to get my script to be able to read from the command line
arguments as well as take input from a pipe. This is what I have basically:
#--- (begin) #
#!/bin/perl
use warnings;
sub parseFile()
{
while () {
# do some processing to
Jeff Westman wrote:
>
> Hi,
Hello,
> I am trying to get my script to be able to read from the command line
> arguments as well as take input from a pipe. This is what I have basically:
>
> #--- (begin) #
> #!/bin/perl
> use warnings;
>
> sub parseFile()
On Tuesday, June 24, 2003 at 4:15 PM, Dan Muey stated:
:
: This is last post for me today I swear!!!
But . . .
On Tuesday, June 24, 2003 at 4:38 PM, Dan Muey posted:
: Cool, Thanks again Jenda, it's coming slowly,
: bit by bit.
Just can't trust that guy! :)
Charles K. Clarkson
--
Hi all,
May be Cobol files (data and index files) too.
Josimar
- Original Message -
From: "Ned Cunningham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 24, 2003 1:45 PM
Subject: Binary file conversion
> HI all.
>
> I have what appears to be a C++ file set (i.e. ph
try doing this:
sub {
while ...
}
Look for the removed "()" around the declaration for sub, and u won't tell the sub
that it takes no arguments.
-Sharad
-Original Message-
From: Jeff Westman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 3:23 PM
To: beginners
Subject: R
Sorry for the mistake. It should look like:
sub parse {
while ..
}
-Sharad
-Original Message-
From: Gupta, Sharad
Sent: Tuesday, June 24, 2003 5:58 PM
To: Jeff Westman; beginners
Subject: RE: Reading from STDIN from a pipe
try doing this:
sub {
while ...
}
Look for t
I got caught by something today. So i thought it would be worth mentioning to u.
Just before u do any "sysread" and "syswrite" u may also wish to check whether that
socket is even available for them.
Else ur call to sysread/write may just block.
see "perldoc IO::Select".
-Sharad
-Original
Rudolf Kliemstein wrote:
Hi all,
i have the following problem with the following script:
#!/usr/bin/perl -w
# $Id: cmd.pl,v 1.4 2001/02/22 00:14:48 btrott Exp $
use strict;
use Net::SSH::Perl;
use Net::SSH::Perl::Cipher;
chomp(my $this_host = `hostname`);
print "Enter a host name to connect to:
Jose Malacara wrote:
I have put together a script using the Perl Expect module to log into multiple hosts and execute a list of commands. I would like to be able to capture the output from each host and pattern match against it. The script (login and and issue commands) works fine, but I need some
What do I need to do in order to use a filehandle that was opened earlier in
a program within a subroutine? I've included an example of the code I have
that is not doing what I would like. Basically, I never get any output to
the file. If I change it so that it doesn't use the subroutine when wr
It is supose this code prints the first line of file text.txt (which is
not empty), but it doesn't print anything.
$file = "text.txt";
open (file);
;
print;
close (file);
I understood that ; gets a line (the first in this case) and, in
this case, it puts the line in $_ . Also, print; (witho
That's because when you read from the file handle using the <> brackets, it
doesn't automatically put the line into $_. You're just throwing away the
result. print() does print $_, but in this case there's nothing in it.
BTW, my personal advice would be to avoid the implied $_ magick until you
a
Chris San wrote:
It is supose this code prints the first line of file text.txt (which
is not empty), but it doesn't print anything.
$file = "text.txt";
open (file);
;
The above statement does not store the result in $_, this is special
only inside a while statement
while () is equivalent t
80 matches
Mail list logo