On Thursday 08 June 2006 8:11 pm, Timothy Johnson wrote:
> 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
> cha
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 wa
I use a script that generates stats for clamav. It generates both txt and
html output. The problem is that the line length in the txt and html
output differ. For instance in the txt output it shows this: (the numbers
differ because the files were generated at different times)
Email.ScamS.Gen00
On 6/8/06, Lawrence Statton <[EMAIL PROTECTED]> wrote:
> > I would prefer it to return the old value:
> >
> > sub foo {
I see...I i've been more or less looking at the current state
$curr = $foo->bar();
$old = $curr;
$curr = $foo->bar('new value');
--
Anthony Ettinger
Signature: http://cho
-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 whoev
> Are you SURE that there might be commas in the other fields?
> I would hope that whoever made this file you're parsing would
> have thought of this if they ever intended to later use the data.
Good point. But I have no way of verifying that.
These CSV files are provided to me by an outside sou
On 6/8/06, Chad Perrin <[EMAIL PROTECTED]> wrote:
> Yes. Recompile Perl setting the appropriate compile-time flags. More
> importantly, though: Why? It is just easier to install your modules
> in the standardly defined place for site-specific modules.
By install do you mean cp myMod.pm to /
You do not need logic to do that. It would seem better to use:
use lib '/path/to/my/misplaced/perl-modules';
The point is to not have to specify a local path at all:
use lib qw(/path);
push(@inc, '/path');
Each script tests for OS: linux/sunos, and win32, and pushes the path
to @INC ac
On Thu, Jun 08, 2006 at 01:59:46PM -0700, Lawrence Statton wrote:
> > Is there a way to modify @INC for the perl installation as a whole?
>
> Yes. Recompile Perl setting the appropriate compile-time flags. More
> importantly, though: Why? It is just easier to install your modules
> in the stand
-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, s
> Hello Rich
Hi, Chris, thanks for your response
>
> See docs for perlfunc, specifically split.
>
> Especially, the form for split
> 'split /PATTERN/,EXPR,LIMIT'
>
> By setting the limit, you will be able to solve the problem.
>
> Chris
>
The thing is I can't be sure that there will ne
> Is there a way to modify @INC for the perl installation as a whole?
Yes. Recompile Perl setting the appropriate compile-time flags. More
importantly, though: Why? It is just easier to install your modules
in the standardly defined place for site-specific modules.
>
> All my scripts have log
> > I would prefer it to return the old value:
> >
> > sub foo {
> > my $self = shift;
> > my $old_foo = $self->{'foo'};
> > $self->{'foo'} = shift if @_ > 0;
> > return $old_foo;
> > }
> >
> >
>
> If you set a new value, why would you want your client to still be
> using the old value?
B
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 the
> Hello ,
>
> Hope this work.
>
> #!c:/Perl/bin/perl.exe
> use warnings;
> use strict;
> use CGI;
>
> my $query_obj=CGI->new();
>
> #creat webpage
> print $query_obj->header;
> print $query_obj->start_html('My First Webpage');
> if (!$query_obj->param){
> print
> $query_obj->start_
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 comma
Is there a way to modify @INC for the perl installation as a whole?
All my scripts have logic to push the same directory to @INC. It's
rather repetative.
I know I can export PERL_LIB environment variable, but I need
something for all system users (including win32).
--
Anthony Ettinger
Signatu
On 6/8/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
On Thu, 2006-08-06 at 10:56 -0700, Anthony Ettinger wrote:
> i prefer the return once method:
>
> sub foo
> {
> my $self = shift;
> if (@_ == 1) { $self->{'foo'} = shift; }
>
> return $self->{'foo'};
> }
I would prefer it to re
- Original Message -
From: ""RICHARD FERNANDEZ"" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To:
Sent: Thursday, June 08, 2006 11:17 AM
Subject: parsing a CSV file with more fields than column names
Hello All,
I'm just trying to get some ideas for the best way to approach this...
On Thu, 2006-08-06 at 10:56 -0700, Anthony Ettinger wrote:
> i prefer the return once method:
>
> sub foo
> {
> my $self = shift;
> if (@_ == 1) { $self->{'foo'} = shift; }
>
> return $self->{'foo'};
> }
I would prefer it to return the old value:
sub foo {
my $self = shift;
my $
Hi,
Sorry, it was working, found out the problem was due
to something else.
Thanks,
Anu.
--- anu p <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have the following code snippet in which I open
> two
> files for read.
>
> For each line in file 1 (log.txt), I extract the
> test
> name, which is
On 6/8/06, Ricardo SIGNES <[EMAIL PROTECTED]> wrote:
* Graeme McLaren <[EMAIL PROTECTED]> [2006-06-08T05:44:05]
> Hi all, I've just been reading a bit about accessor get/set methods. I
> have a method:
>
> sub even{
>my $self = shift;
>my $even = shift;
>
>$self->{_even} = $even if
sfantar a écrit :
Hello everybody
As the path to a directory under Linux is like /file/file/file where
file can be a word containing either - or _ .
Which regexp can match this in the best way?
I tried (/\w[-]?\w/)+ but it doesn't work well.
Thanks in advance.
Could this be a solution : htt
On Thu, Jun 08, 2006 at 02:54:06PM +0200, William Paulsen (W) wrote:
>
> I'm trying to write a perl script that will run on one server but can
> instruct either socker server deamon on another server to exec any one
> of three applications on a different box. The reason for this is the
> password
sfantar schreef:
> As the path to a directory under Linux is like /file/file/file where
> file can be a word containing either - or _ .
> Which regexp can match this in the best way?
> I tried (/\w[-]?\w/)+ but it doesn't work well.
You have two slashes in there, as if you want to match
/file//
From: William Paulsen (W)
Sent: Thu 2006-06-08 14:54
To: beginners@perl.org
Subject: Exec a script on one server that will exec other scripts on a
different server..
Hi,
I'm trying to write a perl script that will run on one server but can
instruct either so
Hi,
I have the following code snippet in which I open two
files for read.
For each line in file 1 (log.txt), I extract the test
name, which is of format "dir/file" which is my
pattern and search for the line with same pattern in
file 2 (rg_table.txt). Somehow it's not working.
open (TST_IN, "r
Hello everybody
As the path to a directory under Linux is like /file/file/file where
file can be a word containing either - or _ .
Which regexp can match this in the best way?
I tried (/\w[-]?\w/)+ but it doesn't work well.
Thanks in advance.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
On 6/8/06, Vijay Kumar Adhikari <[EMAIL PROTECTED]> wrote:
How do I know which "perl" executable CGI is
running
If your sysadmin won't tell you, upgrade your sysadmin. :-)
But you can use Inside to tell you about your CGI configuration,
including which perl binary runs it:
http://search.c
On 6/8/06, chen li <[EMAIL PROTECTED]> wrote:
Dear all,
How can I add a line (lines) to the following script
so that I can show the results on a new browser window
after I press the submit button?
Thanks,
Li
#!c:/Perl/bin/perl.exe
use warnings;
use strict;
use CGI;
my $query_obj=CGI->new()
Hello All,
I'm just trying to get some ideas for the best way to approach this...
I have a CSV file whose first line is a header. According to this header
there should be 17 values per line. Unfortunately this is not the case.
It seems that the first 16 header values match up with the first 16
va
Vijay Kumar Adhikari a écrit :
FC3
On 6/8/06, sfantar <[EMAIL PROTECTED]> wrote:
Vijay Kumar Adhikari a écrit :
> Thanks, but I am not using mod_perl.
>
> The problem is twofold. It works well when accessed from CGI. It
> doesn't complain anything at all. When run in command line, it
> generate
FC3
On 6/8/06, sfantar <[EMAIL PROTECTED]> wrote:
Vijay Kumar Adhikari a écrit :
> Thanks, but I am not using mod_perl.
>
> The problem is twofold. It works well when accessed from CGI. It
> doesn't complain anything at all. When run in command line, it
> generates that error.
>
> My questions a
Vijay Kumar Adhikari a écrit :
Thanks, but I am not using mod_perl.
The problem is twofold. It works well when accessed from CGI. It
doesn't complain anything at all. When run in command line, it
generates that error.
My questions are: 1) How do I know which "perl" executable CGI is
running and
>Adding it would be an advantage, however right now I just need setup a
>client side script that'll tell the server side to exec/run one of
>three scripts on the other server.
We have a similar situation. One thing we did on the boxes we could not add
the key pairs was add a cron that ran a scrip
Thanks, but I am not using mod_perl.
The problem is twofold. It works well when accessed from CGI. It
doesn't complain anything at all. When run in command line, it
generates that error.
My questions are: 1) How do I know which "perl" executable CGI is
running and 2) How do I fix that error with
Vijay Kumar Adhikari a écrit :
Hello, I was running an earlier version of perl and upgraded to the
latest one. Now when I run perl from command line, I get an error like
this
[Thu Jun 8 18:57:18 2006] Importer_mysql.pl: install_driver(mysql)
failed: Can't load
'/usr/local/lib/perl5/site_perl/5.
hi,
I am totally a beginner at perl. I have to write a perl script as following:
I am given a ldif(ldap interchange format) file which contains all the
information about all employees of my organization. I can use ldapsearch to
extract information about one particular employee. I am also given a
Adding it would be an advantage, however right now I just need setup a
client side script that'll tell the server side to exec/run one of
three scripts on the other server.
tks
William
Gugulethu
-Original Message-
From: Jerry DuVal [mailto:[EMAIL PROTECTED]
Sent: 08 June 2006 03:09 PM
T
>-Original Message-
>From: William Paulsen (W) [mailto:[EMAIL PROTECTED]
>Sent: Thursday, June 08, 2006 8:54 AM
>To: beginners@perl.org
>Subject: Exec a script on one server that will exec other scripts on a
>different server..
>
>
>Hi,
>
>I'm trying to write a perl script that will run o
Hi,
I'm trying to write a perl script that will run on one server but can
instruct either socker server deamon on another server to exec any one
of three applications on a different box. The reason for this is the
password changes every month and the scripts that I'm currently using
fails becaus
Hello, I was running an earlier version of perl and upgraded to the
latest one. Now when I run perl from command line, I get an error like
this
[Thu Jun 8 18:57:18 2006] Importer_mysql.pl: install_driver(mysql)
failed: Can't load
'/usr/local/lib/perl5/site_perl/5.8.8/i686-linux/auto/DBD/mysql/my
* Graeme McLaren <[EMAIL PROTECTED]> [2006-06-08T05:44:05]
> Hi all, I've just been reading a bit about accessor get/set methods. I
> have a method:
>
> sub even{
>my $self = shift;
>my $even = shift;
>
>$self->{_even} = $even if defined($even);
>return $self->{_even};
> }
>
Joshua Colson wrote:
On Thu, 2006-06-08 at 00:55 +0200, Flemming Greve Skovengaard wrote:
If you are just going to print the day number and you have other dates in a
similar format why not just use:
print +(split /\s+/, $date)[2];
Well, in this particular instance, I am. However, there have
Hi all, I've just been reading a bit about accessor get/set methods. I have
a method:
sub even{
my $self = shift;
my $even = shift;
$self->{_even} = $even if defined($even);
return $self->{_even};
}
This basically does what a get and set method would do. So why would I need
a
my ($option) = $_ =~ s/(.*?)#/; #skip inline comments
should be
m//, not s//
On 6/8/06, Anthony Ettinger <[EMAIL PROTECTED]> wrote:
On 6/8/06, Graeme McLaren <[EMAIL PROTECTED]> wrote:
> Hi Anthony, good idea about overriding the table names. I had a feeling
> there would be a conf file som
On 6/8/06, Graeme McLaren <[EMAIL PROTECTED]> wrote:
Hi Anthony, good idea about overriding the table names. I had a feeling
there would be a conf file somewhere. As I am outputting the results of the
SELECT to an HTML::Template I am already using a Conf file which is another
class. This leads
Hi Anthony, good idea about overriding the table names. I had a feeling
there would be a conf file somewhere. As I am outputting the results of the
SELECT to an HTML::Template I am already using a Conf file which is another
class. This leads me on to another question. If I instantiate my cla
On 6/8/06, Graeme McLaren <[EMAIL PROTECTED]> wrote:
Hi all, this class that I have written lists the contents of a "log" table
when the $log->view method is invoked. There is some hardcoded SQL in this
method and all I do is pass it a number which then looks up the relevant
records. This reall
Hi all, this class that I have written lists the contents of a "log" table
when the $log->view method is invoked. There is some hardcoded SQL in this
method and all I do is pass it a number which then looks up the relevant
records. This really isn't a reusable class as far as I understand it
50 matches
Mail list logo