To explain myself, I was actually referring to building perl from
source on Win32 rather than using a distro.
As for me, I use(d) strawberry simply because I found the ppa system
too cumbersome when I tried to combine it with cpan, and once perl
5.10 came out, it started to drag back, so I switche
You don't need Microsoft Visual Studio to install perl modules. I will
go on a limb and assume here you're thinking of using MS Visual C
compiler to compile perl and subsequent c modules, but even that's not
necessary, as you could use MinGW
On 1 June 2011 11:26, Shlomi Fish wrote:
> Hi Sayth,
>
On Mon, Apr 11, 2011 at 04:05:31AM -0700, prashant kaushal wrote:
> Hi Di,
>
> Yesterday i tried a "Hello world" program in perl using cgi script on a
> windows platform. The steps i followed were:
>
> 1. Made a directory in "C:" and named it "cgi-bin"
> 2. Wrote my source code file and saved i
spoke too soon. seems that under both linux and windows perl does read
the shebang line. please ignore previous comment
On 7 March 2011 10:24, Erez Schatz wrote:
> On 22 February 2011 17:19, Shawn H Corey wrote:
>>> when I put this line in a script say a.pl:
>>> #!/usr/bin/
On 22 February 2011 17:19, Shawn H Corey wrote:
>> when I put this line in a script say a.pl:
>> #!/usr/bin/perl -wl
>> so, does this make perl ignore the "wl" switch in the script?
>
> No, perl reads the shebang line and sets the options.
perl doesn't do any such thing. In a *nix shell environme
On 20 January 2011 15:38, Eyal B. wrote:
> I'm writing a scripts that check the TTL of the ping and found the OS.
> According the TTL - the script should let me know which OS it is :
> Linux/ Windows or Unix (Hash table)
>
> I'm getting an error on the line where I should use the TTL variable -
>
On Thu, 30 Dec 2010 12:35:37 +0200, Shlomi Fish
wrote:
On the other hand, most of my
posts (and those of most other active members of the lists) were
replies
for people asking for help, while trying to be helpful. And since I
subscribed I've posted much more posts than you.
Why do you f
On 12/28/2010 01:04 PM, Shlomi Fish wrote:
> Hello Erez (and all),
>
> On Tuesday 28 Dec 2010 11:01:40 Erez Schatz wrote:
>> This is so blatantly OT it shouldn't be on this list.
>>
>
> Maybe my impression is a bit biased, but it seems to me that most of your
>
This is so blatantly OT it shouldn't be on this list.
--
Erez
Observations, not opinions.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On 12/27/2010 06:11 AM, Sisyphus wrote:
>
> - Original Message - From: "Randal L. Schwartz"
>
> To:
> Sent: Monday, December 27, 2010 1:57 PM
> Subject: Re: Syntax Errors
>
>
>>> "Bill" == Bill Casey writes:
>>
>> Bill> Syntax error at import_track.pl line 11, near ") {"
>> Bill
> On 26/dic/2010, at 19:54, SERIER wrote:
>
>> What are some of the best books for newbies to perl?
For a programming beginner in general, Learning Perl
(http://oreilly.com/catalog/9780596520106/ by Randal Schwartz, Tom
Phoenix, and Brian D. Foy, aka the Llama book) is an excellent book. For
som
On 12/15/2010 04:09 PM, Jeff Peng wrote:
> Hi,
>
> I have intalled activeperl 5.10 on windows and try to install a perl
> package.
Hello Jeff,
If possible, I recommend installing from the Strawberry Perl
distribution: http://strawberryperl.com
It includes a functioning cpan client, and comes wit
On 11/29/2010 03:27 AM, Kenneth Wolcott wrote:
>
> The reason one should use File::Basename and File::Spec is that you
> can become platform-independent instead of Windoze-worshipping :-)
>
> Ken Wolcott
>
I worship whatever I'm paid to work on. For a Windows shop, the overhead
of platform in
On Fri, 26 Nov 2010, Shlomi Fish wrote:
Actually I use Alpine, but thanks for that warning, I'll make sure to
delete all links from my future posts, because research shown that humans
are intelligent enough to follow a thread without being spoonfed through
the throat.
Hi Erez,
next time, pl
There are many books available,
On Fri, 26 Nov 2010, Shlomi Fish wrote:
Hi Uma,
welcome to the Perl world.
On Thursday 25 November 2010 17:12:49 Umashankar wrote:
Hi All,
I started my career in a software firm, am working in PERL platform.
Can some one guide me by providing some online tuto
On 10/08/2010 12:07 AM, Shlomi Fish wrote:
> Hi all,
>
> after being tired of telling Perl newcomers about the same problems with
> their
> code times and times again, I've decided to create this page detailing "Perl
> Elements to avoid":
Nobody is forcing you to tell anyone anything. Teaching
On 09/25/2010 01:57 AM, Vaishnavi Saba wrote:
> @common = inter( \%foo, \%bar, \%joe );
> sub inter {
> my %seen;
> for my $href (@_) {
> while (my $k = each %$href ) {
> $seen{$k}++;
> }
> }
> return grep { $seen{$_} == @_ } keys %seen;
> }
Usually not a go
First, I urge you to try parsing this doc with a dedicated RSS parser,
it will do miracles for your needs. Second, the dumper you print here
is not the full document, but one branch, it might be that what you
loop over is not an arrayref, or might not work the way you think. Try
running a Dumper ov
On 28 July 2010 01:31, Jane D. wrote:
>
> I'm basically retrieving an XML file from Digg. I can retrieve the
> Digg data okay, but am struggling with trying to process the returned
> data with Perl, largely on account with my unfamiliarity with XML
> processing, but also because I'm not entirely c
On 13 July 2010 18:16, Shawn H Corey wrote:
> Because [] define a character set; everything inside it is a character.
> That means it does not expand \1.
That's not entirely correct. Character classes recognize variables,
escaped characters and some other regexp notation, but not \1
back-refer
On 13 July 2010 13:00, Bryan R Harris wrote:
>
> I thought this would work:
>
> s/(['"])([^\1]*)\1/${1}.despace($2).$1/gse;
>
> ... but it doesn't. It looks like the [^\1]* in the regexp isn't working
> right.
Character classes (characters inside square brackets - []) in regexp
notation, inter
For a windows machine, I'd actually recommend a non-perl solution,
called autoit, available here
http://www.autoitscript.com/autoit3/index.shtml. It's a
Windows-oriented scripting language which is very useful for
automating actions in the GUI and the GUI system (in Windows, the GUI
is an integral
All this and more is available at http://perldoc.perl.org/perlre.html
On 27 April 2010 12:39, Erez Schatz wrote:
> You need to specify that the string you look for should not appear in
> the part you try to extract, meaning instead of .*? you should be
> looking for (not abc)*? In perl
You need to specify that the string you look for should not appear in
the part you try to extract, meaning instead of .*? you should be
looking for (not abc)*? In perl, we have the negative lookahed for
that: (?!...): m/abc((.(?!abc))*?)xyz/
However, this would fail if you have a string abc abcabc
On 24 February 2010 15:03, HACKER Nora wrote:
>> Normally - shortened to <> is preferable over ;
>
> I initially used this syntax but received an error because I start my
> script with 1-2 parameters (one required, second one optional):
>
> oracle:/opt/data/magna/wartung>dbmove.pl T D
> Can't op
On 2 February 2010 15:06, Shlomi Fish wrote:
>
> Ahmm... no.
Are you physically unable to say anything in a social manner?
>
> <<<
> my %hash = (3 => <<"EOF");
>
>
>
>
> This is called a cross-site scripting attack (
> http://en.wikipedia.org/wiki/Cross-site_s
On 2 February 2010 09:19, venu madhav wrote:
> I've a situation where I create a hash variable in PERL and
> use it in Java script which is embedded in the CGI. The key for that
> hash is taken from JavaScript. For ex:
>
> - CGI code
> my %hash{3}=300;
> --JScript code---
> var
On 2 February 2010 13:46, Shlomi Fish wrote:
> Regarding "PERL" - it's either "perl" or "Perl" but never "PERL":
>
> http://perl.org.il/misc.html#pl_vs_pl
What does have got to do with the question?
>
> Please go to http://perl-begin.org/ and find a good resource to learn Perl. To
> qoute Mark J
2010/1/19 harish behl :
> My Script has to search a particular string like "\$Header\$" in files and if
> this string is found, it should replace it with "\$Header
> $NameofFile 01/01/2009". But it's making the files blanks.
This means you have a problem in the part that is writing to the
files,
2010/1/16 Grant :
>>>
base64datahere
base64datahere
base64datahere
>> #!/usr/bin/perl
>>
>> use strict;
>> use warnings;
>> use XML::Simple;
>>
>> my $data = XMLin($path_to_file);
>>
>> foreach my $image (@{$data->{Label}->{Image}}) {
>> print "$image-
>
>>
>> base64datahere
>> base64datahere
>> base64datahere
>>
>>
>>
>> I need to be able to grab the correct set of base64 data. Does anyone
>> know how to do that?
It's a common practice, to avoid using XML::Simple. It's also a common
practice not to give practical suggestions. Since you *di
2010/1/9 C.DeRykus :
> On Jan 5, 12:13 am, moonb...@gmail.com (Erez Schatz) wrote:
>> 2010/1/5 Jeff Peng :
>> ...
>>
>> This is something that Perl (post version 5.6) does inherently, which
>> is compiling a regex only once as long as the pattern isn't mod
2010/1/5 Jeff Peng :
> Hello,
>
> Can the code (specially the regex) below be optimized to run faster?
>
> #!/usr/bin/perl
> for ($i=0; $i<1000; $i+=1) {
>
> open HD,"index.html" or die $!;
> while() {
> print $1,"\n" if /href="http:\/\/(.*?)\/.*" target="_blank"/;
> }
> close HD;
> }
theore
Shlomi, please stop correcting the English of those who post here.
It's rude, off-topic, and unimportant. This isn't a language mailing
list and you are not its chief linguistic officer. I understand you
take pride in your English, since you are not a native speaker, but
that has nothing to do with
On 28/12/2009, Shlomi Fish wrote:
> Hi Christoph!
>
> On Monday 28 Dec 2009 13:11:17 Christoph Friedrich wrote:
>> My Big Problem is that I must copy an object to do a backtracking method
>> (I am going to develop a sudoku solver).
>>
> Moreover, I should note that there are plenty of Sudoku solv
2009/12/23 Raheel Hassan :
> Thanks for your reply Schatz. Yes i installed many modules using the same
> method but the problem that i am facing this time is due to this package
> SNMP_session.pm. In CPAN also i am unable to find this package. Where as in
> Ubuntu it is present in /usr/share/perl5/
2009/12/23 Raheel Hassan :
> Hi,
>
> I need to install SNMP_Session.pm in Fedora core 12, can any one guide me
> how i can install this package and from where i get this. It is working in
> my ubuntu machine but in fedora i am unable to find.
>
(Warning: I have zero experience in Fedora/Red Hat, s
A pox on gmail's "reply" not sending to list.
2009/12/22 Erez Schatz :
> 2009/12/21 Vishnu :
>> I was going through the book intermediate perl and came across the
>> following code.
>
> I'm not familiar with the scope of Intermediate Perl, but fro
2009/12/21 Xiao Lan (小兰) :
> my $dbh = DBI->connect(...);
> my $pid = fork;
> if ($pid ) { # parent
> do something;
> } else { # child
> do something another;
> $dbh->disconnect;
> }
>
> What I want to know is, when $dbh get disconnected in child, will it
> influence the one in parent?
I
2009/12/20 sftriman :
> I've been wondering for a long time... is there a slick (and hopefully
> fast!) way
> to do this?
>
> foreach (keys %fixhash) {
> $x=~s/\b$_\b/$fixhash{$_}/gi;
> }
You can do a global substitute of the sentence and see if they match
any key in the hash. i.e.:
$x =~ s/\b
2009/12/20 sftriman :
> I use this series of regexp all over the place to clean up lines of
> text:
>
> $x=~s/^\s+//g;
> $x=~s/\s+$//g;
> $x=~s/\s+/ /g;
>
You can probably use $x=~s/^(\s+)|(\s+)$//g;
But I don't think it will use any less CPU than the 3 regex option,
the nature of Perl's regex en
One problem I have with Merlyn, is when he starts talking about
something, you're willing to throw everything away and go where he
points. He's such a passionate, compelling speaker.
My other problem is that he's mostly right.
2009/12/19 Philip Potter :
> 2009/12/19 Parag Kalra :
>> Hello All,
>>
2009/12/12 Philip Potter :
> 2009/12/12 Shawn H Corey :
>> Alan Haggai Alavi wrote:
>>> Hi,
>>>
>>> Windows requires you to use double quotes in place of single quotes. Saving
>>> to
>>> a file and executing it is the only way that is cross-platform, I suppose.
>>
>> Doesn't Windows respond to her
2009/12/8 Anders Hartman :
>>> Hello,
>>> I which to use eval to execute subroutines dynamically.
>>> The following code snippet fails:
>>>
>>> #!/usr/bin/perl
>>>
>>> use strict;
>>> use warnings;
>>>
>>> sub asub {
>>> our $abc;
>>> print $abc;
>>> }
>>>
>>> my $abc = "abc\n";
>>> eval "asub";
2009/12/8 Majian :
> my $s = "The black cat jumped from the green tree";
> print index $s, "e", 3 The result is 18
It's slightly confusing, but if you get the idea behind it, it's
actually very simple:
counting from 0, the string "The black cat jumped from the green tree"
has an 'e' at the 2
2009/12/6 Shlomi Fish :
> Hi Agnello!
> That put aside, you really should work on writing your English text better.
> While one can understand it, the style (punctuation, capitalisation, spelling,
> etc.) is horrible.
Not as horrible as the tone of this comment. In Perl we accept that
different l
2009/12/6 Jeff Pang :
> Parag Kalra:
>
>>
>> So what are the main Perl modules which I need to install and any good
>> tutorial link would be really appreciated.
>>
>
> For the modules, CGI and DBI is mostly what you wanted, these two modules
> are built-in ones in recent perl release.
I seriously
2009/12/6 Jigme Datse Rasku :
> I believe if you want to do things "much the way PHP does," probably unless
> you have a significant reason to *not* use PHP (either you see another tool
> as "better" or you see PHP as lacking in some respect, I don't see a reason
> not to use PHP.
First, if you kn
2009/11/30 David Schmidt :
> Hello
>
> I would like to execute some Code after a certain amount of time has
> passed (then restart the timer but with a different time value)
> Basically I am looking for something as simple as
>
> my $do_it = { ... };
> use MyTimer;
> my timer = MyTimer->new($dela
2009/11/29 raphael() :
> Hi,
>
> I want the below if loop to end if it cannot find any match & print the die
> message.
> However it just exit without hitting my "die"
> Any Ideas?
>
Lots. First, give us some more information regarding which data you're
comparing to what. In the code example you
2009/11/13 Anant Gupta :
> ohhh ok.
> Thanks for the help
>
> But there is an XML example using XML::Twig in which
> the author has defined the hash as
> my $hash={ 'abc'=>'def'.
> 'ghi'=>'jkl',
> 'mnp'=>'pqr'
> }
>
> I thought it is a refe
2009/11/12 Anant Gupta :
> my %hash;
> my $abc;
> my $count;
> while(defined($ARGV[$count]))
> {
> push(@hash{$abc},$ARGV[$count]);
> }
>
> The error is "Type of arg 1 must be array not hash element ..."
The error is correct, you can't "push" to a hash element. Question is,
what exactly do you
2009/11/3 Majian :
>
> my $i = 1;
> print ++$i + ++$i, "\n";
>
> The above code prints out the answer 6 .
> But in the other language the anser is 5 ,
>
>From the documentation
(http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement):
"Note that just as in C, Perl doesn't defi
2009/11/2 Anant Gupta :
> Hello,
>
> In the foreach loop, without going to the beginning of the loop, i want to
> get the next iteration of data. How do i get it.
> eg
You can always use a for loop and refer to the next item:
for (my $i= 0; $i< @lines; $i++) {
if ($lines[$i + 1] == ...
> use str
2009/10/25 M. E8. H. :
> This is an minor topic. I feel the Camel logo to represent Perl to be
> strange, illogical and slightly ugly. I presume I do not get the humor.
> However I prefer a swiss army knife -liked tool or a red tool box with tons
> of tools to be a better logo. Like C, P
2009/10/24 :
> I'm always wanting to know this. Thanks.
>
O'Reilly media, publishers of Programming Perl (as well as Learning,
Advance, Mastering, Best Practices, Cookbook and many other Perl
books), have a practice of placing animal drawings on the cover of the
books and the Programming Perl boo
2009/10/12 :
> rea...@newsguy.com writes:
>
>> What is the proper way to escape or protect an `at sign' (@) inside a
>> perl script where you might need it for sending email.
At the most basic level, using single quotes ('like this') rather than
double quotes ("like this") will not interpolate an
2009/9/10 Philip Potter :
> 2009/9/10 Tariq Doukkali :
>> Hi,
>>
>> i can not understand, what does this code:
>>
>>
>> $| = 1;
This means the programmer wishes that the buffer will be flushed after
every write, or print.
Normally (i.e. $| = 0), the computer stores output in a buffer, which
is pro
Accidentally sent to Gabor, rather to the list:
2009/9/7 Gabor Szabo :
> Hi,
>
> Many projects assume a lot of background already that beginners
> might not yet have. What things would beginners need in order to
> get involved in a project?
I think it all boils down to clear, simple guides on the
2009/9/4 Noah Garrett Wallach :
> is there any way to search for the following text? In some cases the text
> that I am search could be
>
> "one-two-three-"
> or sometimes the text could be "one-two-"
If you're looking for this specific text then a good answer was
already given, but if that's an
You can also read on all the special variables in Perl by typing
'perldoc perlvar' on your shell, or at
http://perldoc.perl.org/perlvar.html
2009/8/21 Erez Schatz :
> 2009/8/21 :
>> In *NIX shell scripting, the variable $0 refers to the
>> zeroth command line parame
2009/8/21 :
> In *NIX shell scripting, the variable $0 refers to the
> zeroth command line parameter,
> i.e., the program itself. I would like to use something like this in my
> perl scripts. Is there an
> equivalent to this in perl?
>
(un)surprisingly enough, it's $0.
--
Erez
"The governmen
2009/5/25 sanket vaidya :
> What is the difference between the 'for' & 'foreach' loops?
There is none.
http://perldoc.perl.org/perlsyn.html#Foreach-Loops :
"The foreach keyword is actually a synonym for the for keyword, so you
can use foreach for readability or for for brevity. (Or because the
I recommend Strawberry Perl (http://strawberryperl.com), it's closer
to the Perl "idea" of distribution, especially seeing as ActiveState
isn't as good as it used to be. Also, it uses CPAN out of the box, so
IMO, is much better.
> On Fri, May 15, 2009 at 8:04 PM, JeffHua wrote:
>> Sharan Basappa:
On 4/6/2009 16:18, Telemachus wrote:
On Mon Apr 06 2009 @ 2:44, Irfan Sayed wrote:
please adivce / help
Regards
Irfan
Please don't reply to your own mail as a way of nudging people to reply.
It's more likely to annoy than to get you an answer.
also: http://www.perlmonks.net/?node_id=75567
2009/3/12 Deviloper
> Can somebody explain what Backtracking is?
>
> thanx,
> B.
>
In a nutshell, consider the following regex: /foo((b+)ar)/
a regex engine will check every character in the string that is
checked against until it reaches the first "f". When reached, it will
mark the place and ch
2009/3/11 kevin liu :
> �...@array = qx{ps -ef | grep hald-runner};
> chomp @array;
> foreach ( @array ) {
> if (/grep hald-runner/) {
> next;
> }
> }
>
> Here my confusion comes: What the grep here will mean??
> Here "grep" is just a plain text or a verb w
(This is basically a "name your favourite editor" question.
Here's two ideas I found in my own search:
1. Komodo Edit and Komodo IDE (http://activestate.com/komodo_edit/).
The Free and non-free versions of an IDE/Editor that is created by
ActiveState, who specialise in support for dynamic languag
2009/2/8 Blazer :
> I have limited experience of programming in C & C++ -
Good. Perl has a C-like syntax, and supports a lot of C's idioms. It
is, in my experience easier to learn as a second language, after you
learned (at least some) other language.
> I just kept reading that Perl was a very ea
On 1/31/2009 8:45 AM, Roman Makurin wrote:
Hi All!
Which is best way to parse(not create) RSS Feeds(0.9, 1.0 and 2.0) in
perl ? I looked through XML::RSS, but it looks like mostly for creating
feeds.
It's also for parsing them. Try
#!/usr/bin/perl
use strict;
use warnings;
use XML::RSS;
use
On 1/30/2009 5:34 PM, Octavian Rasnita wrote:
Hello,
Does anyone have some recommendations for some tutorials/documentation
for using perlscript as a client-side language in browsers?
I really recommend against it, whatever was of PerlScript is immensely
dated, and, IIRC, Internet Explorer o
On 1/30/2009 12:59 AM, thebarn...@gmail.com wrote:
Hi
I run this command and pipe the output to a perl one liner. not quite
sure how it parses the data:
svmon -Pt3 | perl -e 'while(<>){print if($.==2 || $& && !$x++); $.=0 if
(/^--+$/)}'
i understand that it resets the line count every time it
2009/1/27 S, Rajini (STSD) :
>
> In perl is there any system defined functions to find out the
> Differences in dates.
>
Not as such. There are ways to do it by using Date:: modules, like
Date::Manip, Date::Calc, or DateTime.
Try the following links for more detailed information about the how.
h
73 matches
Mail list logo