Which editor for Perl hacking are you using


Please no editor war, but I am curious, what's the editor of choice you're using to write Perl, and why (if you want to share). I am currently using Textpad, but in the very near future I am moving to ...
Posted On: Tuesday 27th of November 2012 11:51:40 PM Total Views:  393
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




need to find all the directories which have soft links in it

Hi all, I have a parent directory which contains nearly 10 soft-links to other directories, the linked directory may also contain soft-links to other directories.it goes on like that till the directory doesn't contain any soft-links. How can I get the list of all these directories
VIEWS ON THIS POST

149

Posted on:

Wednesday 17th October 2012
View Replies!

copy the which is before ",(comma)" in one file and matching patternin another file

Problem Def: copy the pattern which before ",(comma)" and find a matching pattern in another file. status: i wrote following code. but it is not working properly. plz help me. #! C:\Perl\bin\perl.exe print "hello\n"; print "Please Enter Input File name(Give the complete path):"; $infile=; #give the input file name here chomp($infile); open ($in, "
VIEWS ON THIS POST

110

Posted on:

Wednesday 17th October 2012
View Replies!

GUI Toolkit - which one to learn? (GTK/GTK2/Tk)

Hi I decided throwing a GUI on Perl would be fun so I want to make a Connect Four. Which GUI module would you advise It seems the major contenders are GTK, GTK2/GTK+ and Tk. Tk seems to have the simplest interface which is nice, but it sure doesn't look as pretty as GTK. I took a peek at the GTK+ docs and, using a C-like API, it looks pretty cumbersome. I would appreciate if you could share your thought and/or views on the topic.
VIEWS ON THIS POST

125

Posted on:

Saturday 20th October 2012
View Replies!

string concatentation vs. interpolation: which one is more optimal?

Programming Perl (The Camel Book) states that "String concatenation is also implied by the interpolation that happens in double-quoted strings." print $a . ' is equal to ' . $b . ".\n"; # dot operator print "$a is equal to $b.\n"; # interpolation Can someone experienced in Perl source code confirm that they are identical in terms of raw speed and memory use or not The second one is much cooler, and if so, I'm going to get rid of concatenation altogether. (I'm not even considering the list variant separated by commas, which is suboptimal). , On Sep 26, 1:41 pm, Michele Dondi wrote: > On Wed, 26 Sep 2007 12:46:32 -0700, Mahesh Asolkar > wrote: > > >cmpthese 2000000 => { > > 'interp' => '$x=$y=303; $z = "$x $y"', > > 'concat' => '$x=$y=303; $z = $x . " " . $y', > > 'listjn' => '$x=$y=303; $z = $x," ",$y', > > The last entry does something completely different altogether, because > the list is evaluated in scalar context, whereas in print() it's in > list context. > Michele and it_says_BALLS_on_your forehead, yes listjn is really quite different from what the OP wanted. I was trying to isolate performance of concatenation and interpolation operations from the IO overhead of print - if at all. I did not pay attention on the side effect on listjn. My apologies. /Mahesh.
VIEWS ON THIS POST

110

Posted on:

Saturday 20th October 2012
View Replies!

FAQ 8.1 How do I find out which operating system I'm running under?

This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.1: How do I find out which operating system I'm running under The $^O variable ($OSNAME if you use English) contains an indication of the name of the operating system (not its release number) that your perl binary was built for. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod. -- Posted via a free Usenet account from http://www.teranews.com
VIEWS ON THIS POST

115

Posted on:

Sunday 21st October 2012
View Replies!

FAQ 4.45 How do I find the first array element for which a condition is true?

# Do this using GREP my @people = ('Jacob Smith', 'Michael Brown', 'Joshua Smith', 'Matthew Cope'); @smiths = grep(/smith/i, @people); , Michele Dondi wrote in comp.lang.perl.misc: > On Fri, 20 Jul 2007 07:22:11 -0700, MrL22 > wrote: > > >Subject: Re: FAQ 4.45 How do I find the first array element for which a > condition is true > ^^^^^ > ^^^^^ > > ># Do this using GREP > > > >my @people = ('Jacob Smith', 'Michael Brown', 'Joshua Smith', 'Matthew > >Cope'); > >@smiths = grep(/smith/i, @people); > > No! > > my $first = (grep /smith/i, @people)[0]; > > But inefficient, because it will grep more than necessary. I prefer to write that my ( $first) = grep ...; It can easily be combined with a check for uniqueness, which is sometimes an issue: my @l = qw( foo bar baz); ( my ( $first) = grep /ba/ => @l ) > 1 and warn "not unique\n"; print "first: $first\n"; Anno , On 7/21/2007 5:00 AM, Michele Dondi wrote: > On 20 Jul 2007 23:50:25 GMT, anno4000@radom.zrz.tu-berlin.de wrote: >> >> It can easily be combined with a check for uniqueness, which is sometimes >> an issue: >> >> my @l = qw( foo bar baz); >> ( my ( $first) = grep /ba/ => @l ) > 1 and warn "not unique\n"; >> print "first: $first\n"; > > for some reason I would have never thought of that, even though every single > bit of syntax and semantics is very clear and well known to me It's not clear to me. Lists return their last element in scalar context, not their length. Is there an implicit anonymous array here Doc pointers appreciated. -mjc
VIEWS ON THIS POST

114

Posted on:

Monday 22nd October 2012
View Replies!

FAQ 8.1 How do I find out which operating system I'm running under?

This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.1: How do I find out which operating system I'm running under The $^O variable ($OSNAME if you use English) contains an indication of the name of the operating system (not its release number) that your perl binary was built for. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

121

Posted on:

Sunday 4th November 2012
View Replies!

FAQ 8.1 How do I find out which operating system I'm running under?

This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.1: How do I find out which operating system I'm running under The $^O variable ($OSNAME if you use English) contains an indication of the name of the operating system (not its release number) that your perl binary was built for. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

125

Posted on:

Sunday 4th November 2012
View Replies!

Launching perl scripts on systems which do not support #!

, I found this in Programming Perl - 3rd edition. Could not understand how this works. #!/bin/sh -- # perl, to stop looping eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; Questions: - Who (I mean which program/shell) runs eval 'exec .' - What is ${1+"$@"}, looks like this makes up the command line arguments to the script - What is the purpose of 'if 0;' on a new line 'perldoc perlrun' documents that -S switch makes perl search $PATH for the script.
VIEWS ON THIS POST

111

Posted on:

Sunday 4th November 2012
View Replies!

problem starting perl script from cron environment - ps: don't knowwhich terminal to select

I have perl program which works just fine on the console, but started in cron environment it prints "ps: don't know which terminal to select" to stderr - btw I don't call ps explicitly at any point in my scripts. Now lets have a look at the details : My script is written in perl, inside that script there is a call in backquotes to an other perl script which starts too. By printf-debugging I could find out that the "ps: don't know which terminal to select" output occurs both in the parent and child script before by first line of code. Does perl call ps before starting\t why does it need a terminal my script do not process stdin and stdout + stderr are redirected into files. And for some reason this problem occurs only when calling a perl script from an other perl script. In interactive mode the script works just fine - I ran it from a ksh. To execute it via cron I write a small ksh script, which reads the environment from the .kshrc an the executes the per script sending stdout and stderr to log-files. Let me try to deconfuse it Cron -> ksh-Script -> perlA -> perlB -> perlC -when calling perlA from ksh - ok, no message - when calling perlB from perlA or perlC from perlB - there is a stderr message "ps: don't know which terminal to select" which must be caused before my first line of code in the child script
VIEWS ON THIS POST

134

Posted on:

Sunday 4th November 2012
View Replies!

FAQ 8.1 How do I find out which operating system I'm running under?

This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.1: How do I find out which operating system I'm running under The $^O variable ($OSNAME if you use English) contains an indication of the name of the operating system (not its release number) that your perl binary was built for. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

93

Posted on:

Wednesday 7th November 2012
View Replies!

Identification of which line causing regex problem

Dear all, I'm modifying a system (totally more than 100000-lines for tens of files) written by others and would like to identify which line leads to the following problem. Invalid [] range "l-c" in regex; marked by <-- HERE in ...
VIEWS ON THIS POST

154

Posted on:

Saturday 10th November 2012
View Replies!

which is better when reading files

hi, who can tell me which is better of the following codes why there are different methods to read files thanks 1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading: $!\n"; while () { print if /blue/; } ...
VIEWS ON THIS POST

173

Posted on:

Saturday 10th November 2012
View Replies!

which widget called my callback sub?

I have 2 buttons in my perl-tk script. they both point to the same callback sub (they have the same -command value). My question is how can I know inside the callback sub which button invoked it I know ...
VIEWS ON THIS POST

114

Posted on:

Sunday 11th November 2012
View Replies!

FAQ 4.45 How do I find the first array element for which a condition is true?

This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
VIEWS ON THIS POST

186

Posted on:

Thursday 15th November 2012
View Replies!

which operator is returning a value from a regex match

Folks, I am posting this question with great trepidation because it could turn out to be a truly dumb question. If the question does not meet the worthiness criterion, my apologies in advance. In the following Perl syntax: "one hello ...
VIEWS ON THIS POST

98

Posted on:

Thursday 15th November 2012
View Replies!

File Browser -> which tree

Hi all, I'm rather new to perl and i would like to make the following script. A perl/tk tool which reads all directory's and files under the executed directory. Place all entry's in a tree. + /usr/scripts/funy.pl +---DIR1 | +---file1 ...
VIEWS ON THIS POST

93

Posted on:

Sunday 25th November 2012
View Replies!

FAQ 8.1 How do I find out which operating system I'm running under?

This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
VIEWS ON THIS POST

71

Posted on:

Monday 26th November 2012
View Replies!

FAQ 3.4 How do I find which modules are installed on my system?

This is an excerpt from the latest version perlfaq3.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
VIEWS ON THIS POST

135

Posted on:

Monday 26th November 2012
View Replies!

Is it possible to hide a widget which was packed ?

In article <429b5e5e$1@news.bezeqint.net>, dv@mailtag.com says... > Hi , > > I have a widget which is being built on any case, but is packed (displayed) > only if a certain button is pressed at run-time. > This works great. > ...
VIEWS ON THIS POST

139

Posted on:

Monday 26th November 2012
View Replies!