Hi Dariusz,
On Thu, 9 May 2013 10:08:38 -0500
Dariusz Dolecki wrote:
> How do I add existing custom built perl modules that were built on a
> different system to another one, I have copied over the .pm file.
>
Put them in the @INC :
[ IRC ]
perlbot: @INC
rindolf: To change @INC (perldoc perl
How do I add existing custom built perl modules that were built on a
different system to another one, I have copied over the .pm file.
Thanks in advance.
On Mon, Oct 17, 2011 at 9:07 PM, Csanyi Pal wrote:
> Leo Susanto writes:
>
> > On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal
> wrote:
> >> my goal is to get in a directory the following:
> >>
> >> PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg
> >> PIC2.JPG renamed as Gyermekolimpia_
http://perldoc.perl.org/perlre.html
s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i
>From your requirement: PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg
1. the 3 last digits should be extracted: .+(\d{3}).jpg
2. rename everything before the 3 digits to:
'Gyermekolimpia_Ujvidek_':
s/.+(\
Leo Susanto writes:
> On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal wrote:
>> my goal is to get in a directory the following:
>>
>> PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg
>> PIC2.JPG renamed as Gyermekolimpia_Ujvidek_002.jpg
>> ...
>> PIC00223.JPG renamed as Gyermekolimpia_Uj
s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i
On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal wrote:
> Hi,
>
> my goal is to get in a directory the following:
>
> PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg
> PIC2.JPG renamed as Gyermekolimpia_Ujvidek_002.jpg
> ...
> PIC00223.JPG r
Hi,
my goal is to get in a directory the following:
PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg
PIC2.JPG renamed as Gyermekolimpia_Ujvidek_002.jpg
...
PIC00223.JPG renamed as Gyermekolimpia_Ujvidek_223.jpg
So far I get this to work:
rename -n 's/\w\w\w\w\w/sprintf("Gyermekolim
Hi Rajeev,
On Sun, 4 Sep 2011 08:05:52 -0700 (PDT)
Rajeev Prasad wrote:
> Shlomi Fish,
>
> this is not complete code but part of it, '...' in top and bottom denote
> that, strict warning etc is used.
Well, first of all, it would be a good idea to include the complete code. Using
"..." to denot
s suggested the same.
From: Shlomi Fish
To: Rajeev Prasad
Cc: Perl Beginners
Sent: Sunday, September 4, 2011 1:25 AM
Subject: Re: [solved] parsing and adding back this string
Hi Rajeev,
please acknowledge you have received and read this message.
On Sat, 3 Sep 2011
Rajeev Prasad wrote:
$k=1;
my $arSZ = @tmpAR=split(/"/,$line);
for $x (0..$arSZ-1){
if ($x % 2 == 0) {
push(@modline,"$tmpAR[$x]");
} else {
my $count = $tmpAR[$x-1] =~ tr/,/,/;#try for something more
correct like... =~ m/\,/g);
$k = $k + $count;
pus
Hi Rajeev,
please acknowledge you have received and read this message.
On Sat, 3 Sep 2011 15:47:42 -0700 (PDT)
Rajeev Prasad wrote:
> ...
> ...
>
> $k=1;
> my $arSZ = @tmpAR=split(/"/,$line);
> for $x (0..$arSZ-1){
> if ($x % 2 == 0) {
> push(@modline,"$tmpAR[$x]");
>
> } else
line,"STRING.$k");
}
print @modline;
...
...
this replaces fields in quotes with STRING-field number.
From: Rajeev Prasad
To: Perl Beginners
Sent: Saturday, September 3, 2011 10:34 AM
Subject: Re: parsing and adding back this string
comma
er.
From: Rob Dixon
To: Perl Beginners
Cc: Rajeev Prasad
Sent: Saturday, September 3, 2011 4:13 AM
Subject: Re: parsing and adding back this string
On 02/09/2011 23:33, Rajeev Prasad wrote:
> friends,
>
> I am now trying to parse this string in this way...
>
> x= could be a
On 02/09/2011 23:33, Rajeev Prasad wrote:
friends,
I am now trying to parse this string in this way...
x= could be anything including special character
string = xx:ABC,xx,x,x,x,"x,x,x",x,x,x,"x,x",x
string0=ABC
string2="x,x,x"
string3="x,x"
string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x
On Fri, Sep 2, 2011 at 6:54 PM, Rob Dixon wrote:
> I'm afraid your post doesn't make very much sense to me, and doesn't
> contain a question. Can you give an example showing what you want from
> some real data?
Agreed. As you describe, "x" can be anything, yet your sample is full
of x's all over
On 02/09/2011 23:33, Rajeev Prasad wrote:
friends,
I am now trying to parse this string in this way...
x= could be anything including special character
string = xx:ABC,xx,x,x,x,"x,x,x",x,x,x,"x,x",x
string0=ABC
string2="x,x,x"
string3="x,x"
string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x
friends,
I am now trying to parse this string in this way...
x= could be anything including special character
string = xx:ABC,xx,x,x,x,"x,x,x",x,x,x,"x,x",x
string0=ABC
string2="x,x,x"
string3="x,x"
string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x
final string is string1
Chris, your quoting mechanism is extremely unclear. It's difficult to
discern what you wrote and what the people you're quoting wrote.
On Fri, Jul 08, 2011 at 20:05:14 -0400 , Chris Charley wrote:
> Hello JJ,
>
> It is sometimes helpful to put print statements in a routine to
> follow the flow of
""J. S. John"" wrote in message
news:caahf0rkhyip680xk9kz+3q4uvw79s2dh8denulob_2gxlyf...@mail.gmail.com...
Hi all,
I'm teaching myself perl. Right now, I am stuck with this script. I
don't understand how it works. I know what it does and how to do it by
hand.
$n = 1;
while ($n < 10) {
$s
On Sat, Jul 9, 2011 at 1:33 AM, J. S. John wrote:
> Hi all,
> I'm teaching myself perl. Right now, I am stuck with this script. I
> don't understand how it works. I know what it does and how to do it by
> hand.
>
> $n = 1;
> while ($n < 10) {
>$sum += $n;
>$n += 2;
> }
> print "The sum is
On 7/8/11 Fri Jul 8, 2011 4:33 PM, "J. S. John"
scribbled:
> Hi all,
> I'm teaching myself perl. Right now, I am stuck with this script. I
> don't understand how it works. I know what it does and how to do it by
> hand.
>
> $n = 1;
> while ($n < 10) {
> $sum += $n;
> $n += 2;
> }
> pri
Hi all,
I'm teaching myself perl. Right now, I am stuck with this script. I
don't understand how it works. I know what it does and how to do it by
hand.
$n = 1;
while ($n < 10) {
$sum += $n;
$n += 2;
}
print "The sum is $sum.\n"
I know $sum is initially 0 (undef). I see that $sum becomes
venkates wrote:
Hi,
Hello,
This is a snippet of the data
ENTRY K1 KO
NAME E1.1.1.1, adh
DEFINITION alcohol dehydrogenase [EC:1.1.1.1]
PATHWAY ko00010 Glycolysis / Gluconeogenesis
ko00071 Fatty acid metabolism
ko00350 Tyrosine metabolism
ko00625 Chloroalkane and chloroalkene degradation
k
Hi,
This is a snippet of the data
ENTRY K1 KO
NAMEE1.1.1.1, adh
DEFINITION alcohol dehydrogenase [EC:1.1.1.1]
PATHWAY ko00010 Glycolysis / Gluconeogenesis
ko00071 Fatty acid metabolism
ko00350 Tyrosine metabolism
On Oct 23, 2:37 pm, da...@davidfavor.com (David Favor) wrote:
[omitted]
> > Just be sure you know what you are doing. Adding a method to somone else's
> > class can be considered rude. See the NOTE in perldoc perlmodlib.
>
> sub add_class_method {
>
On 2010-10-23 18:50, David Favor wrote:
Given an instantiated class object, what's the
best way to add additional methods after instantiation.
Specifically I'm working with qpsmtpd and desire to
add a method is_spooled() to every session, so I can
call if ($self->is_spooled) rather then is_spoo
On Oct 23, 2:37 pm, da...@davidfavor.com (David Favor) wrote:
> Paul Johnson wrote:
[snip]
> add_class_method($class,$name,$code);
>
> # all three of these invocations works correctly
> test_method($self);
> &$code($self);
> $self->test_method;
>
> }
Hm, strawberr
From: "Jeff Peng"
> > On Sat, Oct 23, 2010 at 07:52:50PM +0200, Shlomi Fish wrote:
>
> >
> > Just be sure you know what you are doing. Adding a method to somone
> > else's
> > class can be considered rude. See the NOTE in perldoc perlmodlib.
>
> On Sat, Oct 23, 2010 at 07:52:50PM +0200, Shlomi Fish wrote:
>
> Just be sure you know what you are doing. Adding a method to somone
> else's
> class can be considered rude. See the NOTE in perldoc perlmodlib.
>
He/she is maybe coming from other language like Ruby.
I
Or perhaps more recommended:
package A;
sub a { print "a" }
package B;
sub A::b { shift->a; print "b" }
(bless {}, "A")->b;
Just be sure you know what you are doing. Adding a method to somone else's
class can be considered rude. See the NOTE in perldoc perl
t; There are closer-to-the-metal ways but they are probably less recommended.
Or perhaps more recommended:
package A;
sub a { print "a" }
package B;
sub A::b { shift->a; print "b" }
(bless {}, "A")->b;
Just be sure you know what you are doing. Adding a method
On Saturday 23 October 2010 18:50:44 David Favor wrote:
> Given an instantiated class object, what's the
> best way to add additional methods after instantiation.
>
> Specifically I'm working with qpsmtpd and desire to
> add a method is_spooled() to every session, so I can
> call if ($self->is_spo
Given an instantiated class object, what's the
best way to add additional methods after instantiation.
Specifically I'm working with qpsmtpd and desire to
add a method is_spooled() to every session, so I can
call if ($self->is_spooled) rather then is_spooled($self)...
Thanks.
--
Love feeling yo
Jeff Pang wrote:
@y=map {$_."\n"} @x;
Why write it that ugly? Whitespace is cheap, "$_\n" looks more readable
to me (and no need for a "slower" block, though that is optimized away
in the new perls anyway).
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional c
-Original-Nachricht-
> Subject: adding \n?
> Date: Wed, 07 Jul 2010 05:30:14 +0200
> From: Noah
> To: Perl Beginners
> Hi there,
>
> I want to add '\n' to each element of @contact_list.
> what are my options for doing so?
>
Hi,
Perl's map
Noah wrote:
Hi there,
Hello,
I want to add '\n' to each element of @contact_list.
what are my options for doing so?
I assume by "add" you mean append? Or do you want to add it somewhere
else in the string?
here is the line
my @contact_list = sort keys %contacts;
snip ---
Hi there,
I want to add '\n' to each element of @contact_list.
what are my options for doing so?
here is the line
my @contact_list = sort keys %contacts;
snip -
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
On Saturday 19 Jun 2010 03:13:44 Joseph L. Casale wrote:
> 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
On 6/18/10 Fri Jun 18, 2010 5:13 PM, "Joseph L. Casale"
scribbled:
> 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]
>
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 ne
Jesus Fernandez wrote:
Dear friends,
Hello
I'm trying to write a program that draws 5,000 numbers from an exponential
distribution with mean 4N/k(k-1)
N=10 000
k = 25
I have this:
#!jesusafernandez/bin/perl
use warnings;
use strict;
$k = 25;
my $k = 25;
$N = 1;
my $N = 10_000
Dear friends,
I'm trying to write a program that draws 5,000 numbers from an exponential
distribution with mean 4N/k(k-1)
N=10 000
k = 25
I have this:
#!jesusafernandez/bin/perl
$k = 25;
$N = 1;
for ($samp=0; $samp<5000; $samp++)
{
while ($k!= "$25")
{
$mean = 4$N/$k($k
On Tue Oct 06 2009 @ 11:24, Jesus Fernandez wrote:
> Dear friends,
>
> I'm working in a genetic drift simulation and I want to add a second
> population to my script, any suggestions how to do that?
Is this a follow-up to a previous question? Either way, please keep in mind
that we don't have any
Dear friends,
I'm working in a genetic drift simulation and I want to add a second
population to my script, any suggestions how to do that?
j
Dear all,
I am already having a XML document. In that document i want add
namespace to an element. How to achieve this.
Regards,
Ganesh
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Fri, 2008-11-21 at 11:02 -0800, [EMAIL PROTECTED] wrote:
> Hello
>
> I have a perl script that is working fine. The script involves creating an
> array of numbers. The values of these numbers in the is quite large (12
> integer digits or more). I can easily display the numbers with a simple p
Hello
I have a perl script that is working fine. The script involves creating an
array of numbers. The values of these numbers in the is quite large (12 integer
digits or more). I can easily display the numbers with a simple print
statement. I want to display the contents with one element per l
, however, so I thought
I'd see if anyone on this list has the power and interest in adding
the FAQ link and fixing the feedback address at http://lists.perl.org
Thanks in advance to anyone who can help with either of these items.
Phil
1. http://www.nntp.perl.org/group/perl.beginners/20
a bit poorly documented.
Usually this means something isn't initialized, I'd say $photo in this
case. Try adding a line like
print STDERR "XP=$xp, YP=$yp
To ensure all your variables contain values. Also have a look at the
carp module it might offer you some additional method
I am not sure what is going on. It works, then it does not? Is there
a solution for this? I have been able to find little to NO doc on
this.
use strict;
.
.
.
sub picture {
my $picture = shift;
my $xp = shift;
my $yp = shift;
my $sp = shift;
$photo->image
On Jan 16, 6:21 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
> [EMAIL PROTECTED] wrote:
> > On Jan 15, 10:57 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
> >> [EMAIL PROTECTED] wrote:
> >>> How do I change the value stored to a hash reference?
> >> C:\home>type test.pl
> >> my %hash = (
> >>
[EMAIL PROTECTED] wrote:
On Jan 15, 10:57 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
[EMAIL PROTECTED] wrote:
How do I change the value stored to a hash reference?
C:\home>type test.pl
my %hash = (
key => {
refkey => 'oldvalue',
},
);
print "$hash{key}->{refkey}\n";
$
[EMAIL PROTECTED] wrote:
On Jan 15, 10:57 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
[EMAIL PROTECTED] wrote:
How do I change the value stored to a hash reference?
C:\home>type test.pl
my %hash = (
key => {
refkey => 'oldvalue',
},
);
print "$hash{key}->{refkey}\n";
$
On Jan 15, 10:57 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
> [EMAIL PROTECTED] wrote:
> > How do I change the value stored to a hash reference?
>
> C:\home>type test.pl
> my %hash = (
> key => {
> refkey => 'oldvalue',
> },
> );
> print "$hash{key}->{refkey}\n";
> $hash{k
[EMAIL PROTECTED] wrote:
On Jan 14, 6:18 pm, [EMAIL PROTECTED] (Rob Dixon) wrote:
[EMAIL PROTECTED] wrote:
>
This is the bit of code I'm attempting to use,
"$workPackages{ $tempHash{ WORK_PACKAGE } }
{ $tempHash{ USE_ON_CODE } } = $tempHash{ TECHNICAL_DIRECTIVE };" I
get the following error
[EMAIL PROTECTED] wrote:
How do I change the value stored to a hash reference?
C:\home>type test.pl
my %hash = (
key => {
refkey => 'oldvalue',
},
);
print "$hash{key}->{refkey}\n";
$hash{key}->{refkey} = 'newvalue';
print "$hash{key}->{refkey}\n";
C:\home>test.pl
oldvalue
newv
On Jan 14, 6:18 pm, [EMAIL PROTECTED] (Rob Dixon) wrote:
> [EMAIL PROTECTED] wrote:
>
> >
>
> > This is the bit of code I'm attempting to use,
> > "$workPackages{ $tempHash{ WORK_PACKAGE } }
> > { $tempHash{ USE_ON_CODE } } = $tempHash{ TECHNICAL_DIRECTIVE };" I
> > get the following error, "Can'
[EMAIL PROTECTED] wrote:
>
This is the bit of code I'm attempting to use,
"$workPackages{ $tempHash{ WORK_PACKAGE } }
{ $tempHash{ USE_ON_CODE } } = $tempHash{ TECHNICAL_DIRECTIVE };" I
get the following error, "Can't use string ("1") as a HASH ref while
"strict refs" "
Is this because the valu
[EMAIL PROTECTED] wrote:
This is the bit of code I'm attempting to use,
"$workPackages{ $tempHash{ WORK_PACKAGE } }
{ $tempHash{ USE_ON_CODE } } = $tempHash{ TECHNICAL_DIRECTIVE };" I
get the following error, "Can't use string ("1") as a HASH ref while
"strict refs" "
For me, that piece of cod
This is the bit of code I'm attempting to use,
"$workPackages{ $tempHash{ WORK_PACKAGE } }
{ $tempHash{ USE_ON_CODE } } = $tempHash{ TECHNICAL_DIRECTIVE };" I
get the following error, "Can't use string ("1") as a HASH ref while
"strict refs" "
Is this because the value stored needs to be the refe
On Jan 3, 12:19 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
> If you mean that it doesn't report an error if you write
>
> AddConnection({ RemoteName => 'Nash' });
>
> then it's simply because you haven't asked it to do anything. You don't
> get a local connection to a resource though - nothin
From: Nash <[EMAIL PROTECTED]>
> Thanks to Rob and purlgurl, who answered me by mail. It turns out
> RemoteName was wrong. Nevertheless, it worked when I didn't define
> other RemoteShare parameters. Could anyone explain that?
> Since I have a shared folder named Nash on computer named Nash, \\\
>
Nash wrote:
>
Thanks to Rob and purlgurl, who answered me by mail. It turns out
RemoteName was wrong. Nevertheless, it worked when I didn't define
other RemoteShare parameters. Could anyone explain that?
Since I have a shared folder named Nash on computer named Nash, \\\
\Nash\\Nash did the trick
Thanks to Rob and purlgurl, who answered me by mail. It turns out
RemoteName was wrong. Nevertheless, it worked when I didn't define
other RemoteShare parameters. Could anyone explain that?
Since I have a shared folder named Nash on computer named Nash, \\\
\Nash\\Nash did the trick.
Tried answerin
Nash wrote:
Hi all,
I'm new to Perl and I'm trying to use it to connect to a shared disc
through a home network. This is what I've tried:
#!/usr/bin/perl -w
use Win32::NetResource;
On Dec 30, 3:42 am, [EMAIL PROTECTED] (Chas. Owens) wrote:
> What error does it return if you use a LocalName other than X:?
I have tried other LocalNames, tried uppercase and lowercase. It still
gives me ErrorCode 53 (the network path was not found)
:(
Happy New Year to all :)
Nash
--
To uns
On Dec 28, 2007 6:45 AM, Nash <[EMAIL PROTECTED]> wrote:
> On Dec 28, 5:55am, [EMAIL PROTECTED] (Chas. Owens) wrote:
> > It also looks (based on the answer to your second question) like X: is
> > not a valid name. Is it possible that you have already mapped a drive
> > to X:?
>
> Of course not :)
On Dec 29, 2007 7:44 AM, Nash <[EMAIL PROTECTED]> wrote:
> On Dec 28, 7:11pm, [EMAIL PROTECTED] (Chas. Owens) wrote:
>
> > Hmm, does it still work when all you give it is the RemoteName?
>
> Yes it does, that's what's puzzling me. I'll try using the strict and
> warnings pragmas, the way I saw in o
On Dec 28, 7:11 pm, [EMAIL PROTECTED] (Chas. Owens) wrote:
> Hmm, does it still work when all you give it is the RemoteName?
Yes it does, that's what's puzzling me. I'll try using the strict and
warnings pragmas, the way I saw in other scripts.
Nash
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Ooops, accidentaly left the # characters in RemoteShare definition...
Disregard them. :)
Nash
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On Dec 28, 2007 9:45 AM, Nash <[EMAIL PROTECTED]> wrote:
> On Dec 28, 5:55am, [EMAIL PROTECTED] (Chas. Owens) wrote:
>
> > You are not using the strict pragma (this doesn't effect your current
> > problem, but it is still a bad idea).
>
> Like I said, I'm new to Perl. By "pragma" I guess you mean s
On Dec 28, 5:55 am, [EMAIL PROTECTED] (Chas. Owens) wrote:
> You are not using the strict pragma (this doesn't effect your current
> problem, but it is still a bad idea).
Like I said, I'm new to Perl. By "pragma" I guess you mean syntax?
> It also looks (based on the answer to your second questi
On Dec 27, 2007 3:15 PM, Nash <[EMAIL PROTECTED]> wrote:
snip
> The program actually works if I omit the 'LocalName' definition in
> line 4, i.e. it makes the connection. However, since I don't have a
> local name I can't subseqently cancel the connection, and I'd like to
> be able to do that.
> Wi
Hi all,
I'm new to Perl and I'm trying to use it to connect to a shared disc
through a home network. This is what I've tried:
#!/usr/bin/perl -w
use Win32::NetResource;
$RemoteShare
From: "Jeff Pang" <[EMAIL PROTECTED]>
> On 10/22/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I would like, put element's array in hash table.
> > How I can do it ?
> >
>
> Hi,
>
> use AoH,like,
>
> my @array = (1,2,3,4);
> my %hash = (key1 => [EMAIL PROTECTED]);
>
> then y
On 10/22/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I would like, put element's array in hash table.
> How I can do it ?
>
Hi,
use AoH,like,
my @array = (1,2,3,4);
my %hash = (key1 => [EMAIL PROTECTED]);
then you can access the array's first element by,
$hash{key1}->[0];
the
Hello,
I would like, put element's array in hash table.
How I can do it ?
my %numbers = (
zero => '0',
one => '1',
two => '2',
three => '3',
four => '4',
five => '5',
six => '6',
seven => '7',
Thanks all for the help
I'm havng a go wrighting it at the moment
Pat
On 9/13/07, Moon, John <[EMAIL PROTECTED]> wrote:
>
> From: John W. Krahn [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 13, 2007 2:01 PM
> To: Perl beginners
> Subject: Re: adding data to a f
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 13, 2007 2:01 PM
To: Perl beginners
Subject: Re: adding data to a file before it gets regexed
Moon, John wrote:
> From: John W. Krahn [mailto:[EMAIL PROTECTED]
>>
>> Here is another way to do it:
>&g
Moon, John wrote:
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Here is another way to do it:
my $logs_total = () = <*log>;
my $processed = @ARGV = ;
my %logs;
$logs{ $ARGV }++ while <>;
print "There are $logs_total logs HERE\n";
print "I processed $processed logs\n";
for my $filenm ( sort ke
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 13, 2007 12:42 PM
To: Perl beginners
Subject: Re: adding data to a file before it gets regexed
Moon, John wrote:
>
> thanks all for the replies, I'm trying to parse log files.
>
Moon, John wrote:
thanks all for the replies, I'm trying to parse log files.
so I got a bunch of logs in a directory, put them together and then
parse them, I'm trying to keep a reference of the log files, so I
know what log they came from, as I'm need to keep the file name to
put it in to a an
From: Pat Rice [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 13, 2007 11:14 AM
To: Andrew Curry
Cc: Chas Owens; beginners@perl.org; [EMAIL PROTECTED]
Subject: Re: adding data to a file before it gets regexed
thanks all for the replies, I'm trying to parse log files.
so I got a bun
On 9/13/07, Andrew Curry <[EMAIL PROTECTED]> wrote:
>
> But whats your end goal? What is it going to do at the end?
>
> -Original Message-
> From: Pat Rice [mailto:[EMAIL PROTECTED]
> Sent: 13 September 2007 14:16
> To: Chas Owens
> Cc: beginners@perl.org
&
But whats your end goal? What is it going to do at the end?
-Original Message-
From: Pat Rice [mailto:[EMAIL PROTECTED]
Sent: 13 September 2007 14:16
To: Chas Owens
Cc: beginners@perl.org
Subject: Re: adding data to a file before it gets regexed
Thanks Chas for the reply
what I
se
it in a regex afterwards, so it will break out what file was assiated with
the line, as I have a list of files that i am adding together.
I'm using opendir to get a list of files, then opening the files using open,
but I want to add the file to the string.
Thanks
Pat
On 9/13/07, Cha
On 9/13/07, Pat Rice <[EMAIL PROTECTED]> wrote:
> hi all
> I have the following problem.
> I'm trying to read the a file in line by line. using a for each statment,
> but I want to modify each line as it come in so that I can add the file
> name that I am looking in to the line.
>
> eg. looing in
6
47 my $data_file = "test/$datafile2";
48
49
50 open (DATA, "$data_file") or die "can't open $data_file $!";
51
52 #change made here, changing data and adding datafile
53 $DataVariable=;
54 $combined
Jeff Pang wrote:
-Original Message-
From: [EMAIL PROTECTED]
Sent: Aug 7, 2007 10:06 PM
To: beginners@perl.org
Subject: Adding text in file written in Perl
Hello, I have written a Perl script that creates the dhcpd.conf and /
etc/hosts file for Red Hat Linux. The data is derived
-Original Message-
>From: Jeff Pang <[EMAIL PROTECTED]>
>
>1. write that line to hosts file at first,
>open HD,">","/etc/hosts" or die $!;
>print HD "127.0.0.0 localhost.localhostdomain localhost\n";
>close HD;
>
>2. wirte the other lines to hosts file then,
>open HD,">>","/etc/hosts" or
-Original Message-
>From: [EMAIL PROTECTED]
>Sent: Aug 7, 2007 10:06 PM
>To: beginners@perl.org
>Subject: Adding text in file written in Perl
>
>Hello, I have written a Perl script that creates the dhcpd.conf and /
>etc/hosts file for Red Hat Linux. The data is
On Aug 7, 10:06 am, [EMAIL PROTECTED] (Starr Corbin) wrote:
> Hello, I have written a Perl script that creates the dhcpd.conf and /
> etc/hosts file for Red Hat Linux. The data is derived from a single
> text file. What is stumping me is how to insert an automatic text
> line for just the /etc/ho
[EMAIL PROTECTED] wrote:
How
can I get my 127.0.0.0 to appear at the top of my /etc/hosts/ file
every time I run the script to create it?
Rewrite the entire file. Most file systems are not set up to allow you prepend
to a file.
--
Just my 0.0002 million dollars worth,
Shawn
"For the th
Hello, I have written a Perl script that creates the dhcpd.conf and /
etc/hosts file for Red Hat Linux. The data is derived from a single
text file. What is stumping me is how to insert an automatic text
line for just the /etc/hosts part of my script that would
automatically insert a text line at
[EMAIL PROTECTED] wrote:
On Jun 28, 12:00 pm, [EMAIL PROTECTED] (Ved) wrote:
Now I have to print a single line at say line number 20 in each of 150
number of kat.s file.
Hey, another chance to show off my favorite Perl module, IO::All.
Situation is bit complex (atleast for a beginer like me
On Jun 28, 12:00 pm, [EMAIL PROTECTED] (Ved) wrote:
> Now I have to print a single line at say line number 20 in each of 150
> number of kat.s file.
Hey, another chance to show off my favorite Perl module, IO::All.
> Situation is bit complex (atleast for a beginer like me).
Actually it is so si
On 6/28/07, Ved <[EMAIL PROTECTED]> wrote:
open (VEDIN, 'list_of_dir.txt') or die "Cannot open 'File.txt' $!";
Why does the error message mention the wrong file name?
my @rgstr=;
foreach my $file_list (@rgstr) {
print $file_list ;#printing list of dir
The items in this list haven't
Hi all,
I am a beginer in PERL.
What I am trying to do is this:
I have a 150 directories, each having a file "kat.s" in them.
I have names of all these directories in a text file
"list_of_dir.txt".
I have to open the each of "kat.s" in all the 150 directories and add
a line(say "ABCD" at line numb
Hi All,
Situation is bit complex (atleast for a beginer like me).
Directory structure is somewhat like this:
testcases--> 150 Directories (names starting with mixed or green.) ---
> kat.s
i.e. a directrory named testcases has 150 number of directories in it
and each of those 150 number of director
Hi ,
I wanted to put a perl script into the parameter of squid redirect module,
which should have a capable of connecting to another server and passes
another user defined HEADER into the squid back to get access web proxy and
should be handling more threads for all the users .
How it wo
1 - 100 of 289 matches
Mail list logo