I would recommend using the IRC chat or SDL mailing list found here:
http://sdl.perl.org/index.html
At least one of the members that is working on the development side is
coding on a Mac as well (Unfortunately I don't remember the name). kthakore
is generally in the IRC channel most of the time a
Hi Francesco,
On Friday 21 Jan 2011 16:20:51 Francesco Di Lorenzo wrote:
> Hi everyone,
> I've just finished reading Learning Perl by O'Really and I want to learn
> something that can give me something more pleasant to work on, something
> funny, I want to program some basic games like pong...
> F
Hi everyone,
I've just finished reading Learning Perl by O'Really and I want to learn
something that can give me something more pleasant to work on, something
funny, I want to program some basic games like pong...
For this I've found a book that introduces SDL, but I don't know how to
install all t
which
do regex optimizations all the time. beginners more likely need to know
how to write a regex correctly before worrying about their speed,
especially when comparing it to another language.
so to all of you, think about your question before you post it here. is
it really a beginner question?
--- Ryan <[EMAIL PROTECTED]> wrote:
> What is a lexical file handle? I'm working my way
> through Ford's "Perl
> Programming for the Absolute Beginner" (2007) and
> Lee's "Beginning Perl"
> (2004), and they both use the FH style of file
> handle.
>From perl 5.6 you can say,
open my $fh,"te
On 7/19/07, Ryan <[EMAIL PROTECTED]> wrote:
What is a lexical file handle? I'm working my way through Ford's "Perl
Programming for the Absolute Beginner" (2007) and Lee's "Beginning Perl"
(2004), and they both use the FH style of file handle. Should I do
differently?
snip
Yes, you should use
What is a lexical file handle? I'm working my way through Ford's "Perl
Programming for the Absolute Beginner" (2007) and Lee's "Beginning Perl"
(2004), and they both use the FH style of file handle. Should I do
differently?
Thanks.
--Chris
Chas Owens wrote:
On 7/19/07, [EMAIL PROTECTED] <
On 7/19/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
Chas Owens wrote:
> On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote:
>> >
>> > when I use while($line1 = ){
>> >$line = ;
>> > }
>>
>
Chas Owens wrote:
On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote:
>
> when I use while($line1 = ){
>$line = ;
> }
while ($line=)
{
print"$line";
}
2. while ($line =
On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote:
> Hi all
>
> I got started on Perl only today!
> I have a text file in which I need to read a line and the line after
> that. Like
>
> line1 and line2
> line2 and line3
> line3 and line4
On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote:
> Hi all
>
> I got started on Perl only today!
> I have a text file in which I need to read a line and the line after
> that. Like
>
> line1 and line2
> line2 and line3
> line3 and line4
>
> when I use while($line1 = ){
>
Chas Owens wrote:
On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Hrm,
I am confused then:)
I have this as a file I am using right now!
while () {
my @data = split;
next unless @data == 3;
next if grep (/[^0-9.-]/, @data);
printf FILEOUT "X%s Y%s\n", $dat
On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Hrm,
I am confused then:)
I have this as a file I am using right now!
while () {
my @data = split;
next unless @data == 3;
next if grep (/[^0-9.-]/, @data);
printf FILEOUT "X%s Y%s\n", $data[0], $data[1];
uple of
coordinates and processes them perfectly? I also am just learning, so I am not
sure why I need to do more?
Thanks!
jlc
-Original Message-
From: Gary Stainburn [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2007 10:15 AM
To: beginners@perl.org
Subject: Re: Extreme beginner
On Wednesday 18 July 2007 17:08, Joseph L. Casale wrote:
> Is that true?
> I use while loops and they cycle through each line without me keeping
> track? jlc
Yeah, it's true. Why would you want to keep track?
(you can BTW, look at perldoc perlvar for $.)
in my code, the 1st line is written into $
--- Ayesha <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I got started on Perl only today!
> I have a text file in which I need to read a line
> and the line after
> that. Like
>
> line1 and line2
> line2 and line3
> line3 and line4
>
> when I use while($line1 = ){
>$lin
On Wednesday 18 July 2007 06:16, Ayesha wrote:
> Hi all
>
> I got started on Perl only today!
> I have a text file in which I need to read a line and the line after
> that. Like
>
> line1 and line2
> line2 and line3
> line3 and line4
>
> when I use while($line1 = ){
>$l
Hi all
I got started on Perl only today!
I have a text file in which I need to read a line and the line after
that. Like
line1 and line2
line2 and line3
line3 and line4
when I use while($line1 = ){
$line = ;
}
I get output
line1 and line2
line3 and l
Gerben Wierda wrote:
I've got a XML file that contains the following snippet
I've got a XML file that contains the following snippet
Readin
Thanks Solli. :-)
On Thursday 30 November 2006 11:14, Junaid Shariff wrote:
> Hello again. Thanks for the prompt reply. Not sure if i explained my doubt
> clearly.
> Basically I run the ncpmount command, which requires the user to enter the
> remote server password. But that password has already been entered by the
Hello again. Thanks for the prompt reply. Not sure if i explained my doubt
clearly.
Basically I run the ncpmount command, which requires the user to enter the
remote server password. But that password has already been entered by the
user once before and is stored by me in a variable. Now when I ha
I am new to perl and have a doubt. I have a script that needs to run a
command. The command that is being run requires input from the user to
proceed. Instead of prompting the user how can I code the utility to not
prompt the user but take the input from a variable that has the value that
is to be
Hello and welcome!
On Thursday 30 November 2006 10:32, Junaid Shariff wrote:
> I am new to perl and have a doubt. I have a script that needs to run a
> command. The command that is being run requires input from the user to
> proceed. Instead of prompting the user how can I code the utility to not
Hello,
I am new to perl and have a doubt. I have a script that needs to run a
command. The command that is being run requires input from the user to
proceed. Instead of prompting the user how can I code the utility to not
prompt the user but take the input from a variable that has the value that
On Fri, 25 Mar 2005 14:07:02 -0800, Kyle Lampe wrote:
>
> while ( $lineFile1 = && $lineFile2 = ) {
[...snip...]
> But it's complaining about my &&. How can I increment the contents of
> 2 files like this at once?
>
According to "perldoc perlop", the && operator has higher precedence
than th
Kyle Lampe wrote:
Hello!
Hi
I've got a quick perl question for you. I'm writing a script that
compares two xml files, ignoring one certain tag.
The problem I have is I want to get the output from two files simultaneously.
What I'm trying is:
while ( $lineFile1 = && $lineFile2 = ) {
try:
while (
Hello!
I've got a quick perl question for you. I'm writing a script that
compares two xml files, ignoring one certain tag.
The problem I have is I want to get the output from two files simultaneously.
What I'm trying is:
while ( $lineFile1 = && $lineFile2 = ) {
if ( $lineFile1 =~ /$IGNOR
On 22 Mar, "José J. Cintrón" wrote:
> The script works fine as long as I'm not behind a proxy. As soon as I
> get the script behind the proxy where it will reside it ends with a 500
> Exit code. Anyone can provide me any info on how to get the script
> working behind a proxy?
You may conside
I'm sure it's a stupid question that has been asked before (probably a
few 1000 times), but here it goes any way...
I have a script that downloads a file from an ftp site see bellow
use strict;
# --- Customize here ---
my $url = ftp://ftp.server.com/path/";;
my $file = "c:\\download\
[EMAIL PROTECTED] wrote:
> All,
>
> I added the "use strict;" statement to my script for the first time and
> received the following compilation errors:
> Global symbol "$LoginName" requires explicit package name at todaysFiles.pl
> line 43.
This error means that "$LoginName was declared without
On Thu, 3 Apr 2003 14:05:19 -0500, [EMAIL PROTECTED] wrote:
>
> All,
>
> I added the "use strict;" statement to my script for the first time and
> received the following compilation errors:
> Global symbol "$LoginName" requires explicit package n
On 2003-04-03 14:05:19 -0500, [EMAIL PROTECTED] wrote:
>
> All,
>
> I added the "use strict;" statement to my script for the first time and
> received the following compilation errors:
> Global symbol "$LoginName" requires explicit package name at todaysFiles.pl
> line 43.
> Global symbol "$TMPNo
All,
I added the "use strict;" statement to my script for the first time and
received the following compilation errors:
Global symbol "$LoginName" requires explicit package name at todaysFiles.pl
line 43.
Global symbol "$TMPNow" requires explicit package name at todaysFiles.pl
line 45.
Global sym
On Tuesday, Sep 10, 2002, at 07:53 US/Pacific, Mike Singleton wrote:
> Something like this then???
> === Start ===
> use constant JOBSTART => 'SNBJH_3203J';
> # Condense start
> use constant CONDSTART => 'SNBJH_3403';
> # Job end
> use constant JOBEND => 'SNBJH_3211J';
> # Condense end
> u
Error:
Syntax error, near "CONDEND"
== Start ===
# Job start
use constant JOBSTART => 'SNBJH_3203J';
# Condense start
use constant CONDSTART => 'SNBJH_3403';
# Job end
use constant JOBEND => 'SNBJH_3211J';
# Condense end
use constant CONDEND => 'SNBJH_3401J';
# Job cancelled
use constant J
Something like this then???
=== Start ===
use constant JOBSTART => 'SNBJH_3203J';
# Condense start
use constant CONDSTART => 'SNBJH_3403';
# Job end
use constant JOBEND => 'SNBJH_3211J';
# Condense end
use constant CONDEND => 'SNBJH_3401J';
# Job cancelled
use constant JOBCANC => 'SNBJH_3
Janek Schleicher <[EMAIL PROTECTED]> wrote:
> Mike Singleton wrote at Mon, 09 Sep 2002 19:19:22 +0200:
>> ...
>> my %statcode =
>> ( "$JOBEND" => '0',
>> "$CONDEND" => '0',
>> "$JOBFAIL" => '-1',
>> "$JOBCANC" => '-2',
>> );
>
> perldoc -q 'What's wrong with always quot
Mike Singleton wrote at Mon, 09 Sep 2002 19:19:22 +0200:
> I think that I have bit off more than I can chew here
I hope, it's O.K., if I'll give some other hints:
> ...
> my $HELP="
> :
>
> This script must be run on the Backup Express master server.
>
> ";
You could also use a HERE
On Mon, Sep 09, 2002 at 11:24:01AM -0700, david wrote:
> also, the way you create your temp file is not reliable. there are better
> ways to do what you need. you might want to goto cpan and search for a
> module(i can never remember it's name!) that suits your need.
You're probably thinking of
Mike Singleton wrote:
> I think that I have bit off more than I can chew here
>
> Error: The process cannot access the file because it is being used by
> another process.
>
> open (OUTF,">$OUT_TEMP") || die "Cannot open output file $!";
> my @files = glob('3*.log');
> $grepexpr = "egrep
> \
I think that I have bit off more than I can chew here
Error: The process cannot access the file because it is being used by
another process.
== Script ==
#!/usr/bin/perl
###
#
# Copyright (C) 1998 by Syncsort, Inc.
#
Frank 'Olorin' Rizzi wrote:
>Hello everybody.
>
>I am just starting with Perl,
>so the following question will probably appear simple to most of you.
>
>I am trying to get a Perl program to provide me with a listing of the files
>stored on the machine (where the program runs).
>The environment is
Hello everybody.
I am just starting with Perl,
so the following question will probably appear simple to most of you.
I am trying to get a Perl program to provide me with a listing of the files
stored on the machine (where the program runs).
The environment is a Win machine..
Say I have somethin
--- Shawn <[EMAIL PROTECTED]> wrote:
> Geez, if your gonna flame a newcomer, at least answer the question while
> your at it.
This was a flame?
> > We just discussed this today. Please do NOT crosspost. This is better in
> the [EMAIL PROTECTED]
> > list. Further, having a useful subject line
t; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, December 13, 2001 4:22 PM
Subject: Re: beginner question
> We just discussed this today. Please do NOT crosspost. This is better in
the [EMAIL PROTECTED]
> list. Further, having a useful su
We just discussed this today. Please do NOT crosspost. This is better in the
[EMAIL PROTECTED]
list. Further, having a useful subject line helps. If I had a penny for every
unhelpful subject
line I've seen today... hold on a minute... I'd have $1.27 :)
(tip 'o the keyboard to Terry Pratchet
use DB_File;
tie(@array, "DB_File", "/tmp/textfile", O_RDWR|O_CREAT, 0666, $DB_RECNO)
or die "Cannot open file 'text': $!\en" ;
$array[4] = "a new line";
untie @array;
In the above statment what is the following items refering too?
DB_File",
O_RDWR|O_CREAT
0666
DB_RECNO
--
Where may I find some Perl snippets to calculate the response times on a MSSQL
server... not using ping, but actual simple SQL queries??
===
Mike Singleton CCNA, CNE, MCSE
Network Analyst
(253) 272-1916 x1259
(253) 405-1968 (cellular)
[EMAIL PROTECTED]
DaVita Inc.
>> (Original two choices)
>> : Is it better to :
> > :
> > : %Fields = %{$Accts{$account}};
> > : foreach $name ( keys %Fields ) {
> > : print "$name : $Fields{$name}\n";
> > : }
> > :
> > : or
> > :
> > : foreach $name ( keys %{$Accts{$account}} ) {
> > : print "$name : \n";
> > : }
> I
] (Timothy Kimball)
Date: Monday, June 4, 2001 4:00 pm
Subject: RE: Records put into a hash - Beginner Question
>
> Joel Stout wrote:
> : Many thanks, one last tidbit:
> : Is it better to :
> :
> : %Fields = %{$Accts{$account}};
> : foreach $name ( keys %Fields ) {
> :
>
Joel Stout wrote:
: Many thanks, one last tidbit:
: Is it better to :
:
: %Fields = %{$Accts{$account}};
: foreach $name ( keys %Fields ) {
:
: print "$name : $Fields{$name}\n";
: }
:
: or
:
: foreach $name ( keys %{$Accts{$account}} ) {
:
: print "$name : \n";
:
: }
I'd say i
om: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 04, 2001 12:29 PM
To: [EMAIL PROTECTED]
Subject: Re: Records put into a hash - Beginner Question
Joel R. Stout wrote:
: #But when I try to pluck a fields value out, I get hosed
:
: foreach $account (keys %Accts) {
:
Joel R. Stout wrote:
: #But when I try to pluck a fields value out, I get hosed
:
: foreach $account (keys %Accts) {
: print "Fields: \n";
: foreach $name (keys $Accts{$account}) {
: #here's where my brainstorming turns into a light sprinkle
: #there's a scalar here
#!/usr/bin/perl -w
#In page 369 of the Cookbook, I saw that they have a "person" record stored
into the scalar "$Nat", like so:
$Nat = { "Name" => "Guy Person",
"Address" => "123 Itsgee Place",
"Age" => 34,
};
#Say you indexed this by $AcctNo:
$AcctNo = "P123-4
On May 22, Peter Cline said:
>> @parts = split ' ', "this and that";
>> { local $" = ") ("; print "(@parts)"; }
>> # (this) (and) (that)
>
>Will the ") (" assign any amount of space to the list separator?
>This is interesting. I haven't encountered this syntax before.
Using split ' ' is
Thanks for catching my errors. I was thinking too narrowly, using just the
one template provided. This can of course be dangerous, for things change.
At 05:30 PM 5/22/01 -0400, Jeff Pinyan wrote:
>You might want to use the special split ' ' syntax:
>
> @parts = split ' ', "this and that";
On May 22, Peter Cline said:
>Try this.
>my $text = "Browser/Version Platform";
>my ($keep,$discard) = split / /, $text;
>print "$keep\n";
>
>This splits on space and saves the part you want to the variable $keep and
>the rest to $discard.
Actually, it splits on EXACTLY one space. That can cau
> "Peter" == Peter Cline <[EMAIL PROTECTED]> writes:
Peter> Try this.
Peter> my $text = "Browser/Version Platform";
Peter> my ($keep,$discard) = split / /, $text;
Peter> print "$keep\n";
Peter> This splits on space and saves the part you want to the variable $keep
Peter> and the rest to $dis
Try this.
my $text = "Browser/Version Platform";
my ($keep,$discard) = split / /, $text;
print "$keep\n";
This splits on space and saves the part you want to the variable $keep and
the rest to $discard.
Also you could use a regular expression like such:
my $text = "Browser/Version Platform";
$
I need a way to return the start of a line up to the first whitespace.
eg
Browser/Version Platform
I want just the Browser/Version information returned. It should be simple,
but for some reason the solution eludes me.
Any help is appreciated,
Stefan
On May 22, Mark on GCI Server said:
>open(TESTER, "print "Enter a username: ";
>$input = ;
You need to chomp $input, since it has a newline at the end.
>$x = 0;
>$y = 0;
>$w = 0;
>$z = 1;
>if ( ne "") {
That reads a line (and it is lost forever).
>while($line = ) {
>c
]]
Sent: Tuesday, May 22, 2001 09:03
To: [EMAIL PROTECTED]
Subject: Beginner question
Hello all,
I'm trying to populate an array from a file, I think I've got the array
populated, however, I'm not sure. I then want to compare an input against
the array to determine if its there, t
On May 22, Mark on GCI Server said:
> I'm trying to populate an array from a file, I think I've got the array
>populated, however, I'm not sure. I then want to compare an input against
>the array to determine if its there, then look at the second component of
>each record. Any assistance would
Hello all,
I'm trying to populate an array from a file, I think I've got the array
populated, however, I'm not sure. I then want to compare an input against
the array to determine if its there, then look at the second component of
each record. Any assistance would be greatly appreciated.
Thank
At 11:09 21.05.2001 -0700, you wrote:
>if ($oldLot[1] == 0)
>{
> $arpCount = $arp{$lot}; ==> Part 1
>}
>else
>{
> $arpCount = "-"; ==> Part 2
>}
>
>printf "%3s %3d ", $arpCount, $count;
>
>My problem occurs in the "printf" at the "%3s". Here
>is the situation: When $oldLot[1] =
: if ($oldLot[1] == 0)
: {
: $arpCount = $arp{$lot}; ==> Part 1
: }
: else
: {
: $arpCount = "-"; ==> Part 2
: }
:
: printf "%3s %3d ", $arpCount, $count;
:
: My problem occurs in the "printf" at the "%3s". Here
: is the situation: When $oldLot[1] == 0, $arpCount is
: equal to
if ($oldLot[1] == 0)
{
$arpCount = $arp{$lot}; ==> Part 1
}
else
{
$arpCount = "-"; ==> Part 2
}
printf "%3s %3d ", $arpCount, $count;
My problem occurs in the "printf" at the "%3s". Here
is the situation: When $oldLot[1] == 0, $arpCount is
equal to an integer, but when $oldLot
[EMAIL PROTECTED] writes ..
>(name = john)
-
>if I am trying to just extract "john" for the value $b, why would the
>following script not work. I thought it would take bothIt returns the
>full (name=john)
>
>#!user/local/bin/perl -w
>
>open TRY , "try.txt";
>
>while () {
> (my $b=$_) =~ s/
On Wed, 9 May 2001 [EMAIL PROTECTED] wrote:
> I feel strange putting such a simple question on this list, but then
> again, that is why I did not join the experts list.
>
> Any how, if I have a file called "try.txt" with the following line:
>
> (name = john)
>
> if I am trying to just extract "jo
On Wed, May 09, 2001 at 12:27:26PM -0500, John Joseph Trammell wrote:
: On Wed, May 09, 2001 at 01:50:24PM -0400, [EMAIL PROTECTED] wrote:
: > #!user/local/bin/perl -w
: >
: > open TRY , "try.txt";
: >
: > while () {
: > (my $b=$_) =~ s/^(\() (\w+)/$2/;
: > print $b;
: > }
: >
:
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 09, 2001 7:50 PM
Subject: Very beginner question
>
> if I am trying to just extract "john" for the value $b, why would the
> following script not work. I thoug
On Wed, May 09, 2001 at 01:50:24PM -0400, [EMAIL PROTECTED] wrote:
> #!user/local/bin/perl -w
>
> open TRY , "try.txt";
>
> while () {
> (my $b=$_) =~ s/^(\() (\w+)/$2/;
> print $b;
> }
>
> Thank you for humiliating me with this simple question.
Any time.
#!/usr/bin/perl -w
use st
I don't quite understand what your regex is intended to do, but if you try
tr/()//;
s/^.+=//;
it should return John as you intend. The tr will remove the parentheses
and the substitution will match everything up to the = and substitute it
with nothing.
alternatively you could do:
tr/()//
($f
On May 9, [EMAIL PROTECTED] said:
>(name = john)
>
>if I am trying to just extract "john" for the value $b, why would the
>following script not work. I thought it would take bothIt returns the
>full (name=john)
Let's run your regex through the regex explainer:
> (my $b=$_) =~ s/^(\() (\w
I feel strange putting such a simple question on this list, but then
again, that is why I did not join the experts list.
Any how, if I have a file called "try.txt" with the following line:
(name = john)
if I am trying to just extract "john" for the value $b, why would the
following script not w
77 matches
Mail list logo