On 2/17/09 Tue Feb 17, 2009 9:06 AM, Pedro Soto
pedrosoto2...@gmail.com scribbled:
Dear all,
I need to read a huge file and then write only the columns that match
with ids from another file (with less ids) in a sorted fashion.
I made a script thatdoes the work but it takes a lot of time. I
On 2/18/09 Wed Feb 18, 2009 12:06 PM, David Shere
dsh...@steelerubber.com scribbled:
Either I'm blind or the LWP package documentation at
http://search.cpan.org/~gaas/libwww-perl-5.825/lib/LWP.pm doesn't say
what SSL standard it uses, or if it can use more than one.
I recently received
On 2/18/09 Wed Feb 18, 2009 10:20 AM, Rob Canning r...@goto10.org
scribbled:
John W. Krahn said :
Rob Canning wrote:
hi i have a sprintf which uses a scalar as its format:
my $Bformat = %1\$s16- %2\$s16 %3\$s16 %4\$s16 %5\$s16 %6\$s16- %7\$s16
%8\$s16
[...]
any ideas what i am doing
program.
I would suggest that Rob use single-quotes and avoid having to escape the
dollar-signs. The q() and qq() forms are also useful at times.
--
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On 2/23/09 Mon Feb 23, 2009 4:30 PM, Karyn Stump ka...@calarts.edu
scribbled:
I am trying to learn subroutines. I have seen refernces to using my and
local for passing variables so I am playing with them to try to understand
better how this all works.
Neither 'local' nor 'my' is required
On 2/25/09 Wed Feb 25, 2009 5:02 PM, lemba le...@sbcglobal.net
scribbled:
Hi All,
I'm trying to replace some text in file. Below is my script. It
basically makes a copy of line with changes. How can I replace pattern
in the uxix sed way?
I don't use sed, but you can use Perl one-liners
On 2/26/09 Thu Feb 26, 2009 6:24 AM, Irfan Sayed
irfan_sayed2...@yahoo.com scribbled:
Hi All,
I have sorted one array in ascending order. Now i want to store that sorted
output (key/value pair ) in new hash. How can i do that.
By design, hashes do not have an order. Key/value pairs are
On 2/26/09 Thu Feb 26, 2009 8:26 AM, monnappa appaiah
monnapp...@gmail.com scribbled:
Hi all,
I'm using windows machine and i'm using Net::SSH2 module to connect
to remote machine
How can i use the same piece of code to read a list of hosts from a text
file and then connect to
On 2/26/09 Thu Feb 26, 2009 12:34 PM, Rick rich.j...@gmail.com
scribbled:
trying out getting lasrgest key(by value) but below is not working...
help please.
my %files=%{{one =1, thiry =30, four =4, never =997,
forever =11, five =5}};
my $max;
print join( ,keys %files),\n;
=pod
On 2/26/09 Thu Feb 26, 2009 3:53 PM, John W. Krahn jwkr...@shaw.ca
scribbled:
Rick wrote:
trying out getting lasrgest key(by value) but below is not working...
help please.
my %files=%{{one =1, thiry =30, four =4, never =997,
forever =11, five =5}};
my $max;
print join( ,keys
On 2/27/09 Fri Feb 27, 2009 8:33 AM, Rick rich.j...@gmail.com
scribbled:
Jim Gibson wrote:
On 2/26/09 Thu Feb 26, 2009 3:53 PM, John W. Krahn jwkr...@shaw.ca
scribbled:
I get Use of uninitialized value in numeric gt () at ... for that, since
@max is undefined the first time through
On 2/27/09 Fri Feb 27, 2009 5:21 AM, Bill Harpley
bill.harp...@ericsson.com scribbled:
Suppose I have a multidimensional array of the form:
@array[names][values]
There is no such construct in Perl. An array is a one-dimensional list of
scalar values, indexed by integers. You can emulate
On 2/27/09 Fri Feb 27, 2009 2:05 PM, Gunnar Hjalmarsson
nore...@gunnar.cc scribbled:
Which takes us to the obvious step of validating the user input.
my $normal;
while (1) {
print 'Do you want to do the normal thing? [yes] : ';
chomp( $normal = STDIN );
On 3/3/09 Tue Mar 3, 2009 3:05 AM, freefox
robert.lo...@privat.utfors.se scribbled:
Hi,
As join is a build in I guess it should/could be called without
parenthesis.
However these two lines gives me two different answers.
my @strings = ('foo', 'bar');
my $string1 = q{('} . join q{',
dividing the result by 1_000_000 (-s returns size in bytes, not
bits). Or use 1_048_576 if you think megabytes should be a binary number.
--
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On 3/5/09 Thu Mar 5, 2009 1:48 AM, Rock Lifestyle
lifestyle.r...@yahoo.in scribbled:
Hi ,
My directory structure is like
[snipped]
I want to copy some subdirectory and files under it to another directory it
should exactly create similar directory structure
Use the
On 3/10/09 Tue Mar 10, 2009 7:59 AM, Dermot paik...@googlemail.com
scribbled:
Hi,
I am not getting the results that I expect from this test and I am not
sure why. If I run the script below I get:
1..3
Line=???/FOO BAR, Name=Joe Smo M=???
ok 1 - handle_name ???/FOO BAR
Line=change
On 3/10/09 Tue Mar 10, 2009 8:19 AM, howa howac...@gmail.com
scribbled:
Hello,
Consider the code:
#===
use strict;
my $a = 'a.jpg';
if ($a =~ /(html|jpg)/gi) {
print 'ok';
}
#===
Is the brucket () must be needed? Since I am not using
On 3/10/09 Tue Mar 10, 2009 8:41 PM, howa howac...@gmail.com
scribbled:
Hi,
On Mar 11, 1:16 am, nore...@gunnar.cc (Gunnar Hjalmarsson) wrote:
I would do:
if ( $a =~ /\.(?:html|jpg)$/i )
Please readhttp://perldoc.perl.org/perlretut.htmland other appropriate
docs.
Read the
On 3/11/09 Wed Mar 11, 2009 5:28 AM, Dermot paik...@googlemail.com
scribbled:
2009/3/11 Dr.Ruud rvtol+use...@isolution.nl:
Dermot wrote:
I created a small Class, initially with Moose. When I wanted an
instance of the class I would call `my $instance = new MyClass`;
I then removed
On 3/11/09 Wed Mar 11, 2009 11:36 AM, neckha...@penntraffic.com
neckha...@penntraffic.com scribbled:
Hi guys,
I am starting to learn Perl as the ksh scripting language (which I
don't know either) looks less than powerful.
I have used C many years ago, and write my stuff in REXX on a
On 3/12/09 Thu Mar 12, 2009 6:18 AM, Aglipay, Recelyn
recelyn.agli...@ehmc.com scribbled:
Hi Dave,
I'm using a third party application to call the perl script. This
application only allows for subroutines to be written since the app also
uses some perl. So the code below is all I have.
On 3/14/09 Sat Mar 14, 2009 5:28 AM, M. Coiffure coiff...@gmx.at
scribbled:
Hi all
I'm getting this error on the following (test) script:
Can't call method x without a package or object reference at test.pl line 12
ENT line 1
What I want to do is create a HashMap where the keys are
On 3/16/09 Mon Mar 16, 2009 3:05 PM, R. Hicks sigz...@gmail.com
scribbled:
$template-param(
RESULTS = $self-dbh-selectall_arrayref('
SELECT age, day FROM table WHERE id = ?',
{ Slice = {} },
$self-session-param('cell')-{'sid'} )
);
I saw that code and while I do
On 3/16/09 Mon Mar 16, 2009 10:20 AM, vd vvd2...@gmail.com scribbled:
Hi all,
I need to consolidate columns of data available across different
directories into a single excel csv file. Usually we write to a file
row after row but for the current task I have, it would be convenient
to
On 3/17/09 Tue Mar 17, 2009 8:45 AM, Jeff Westman westf...@gmail.com
scribbled:
All,
I know this has been asked many times, and I have read the documentation
(perldoc -q matching over more than one line) and still can't make head
or tails out of this.
I have a problem where my pattern
On 4/4/09 Sat Apr 4, 2009 8:34 PM, Andrew Fithian afit...@gmail.com
scribbled:
What's a slick way to enumerate all subarrays of length n from a master
array of length m? For example I've been enumerating all possible two
card hands from a deck of 52 cards (n=2, m=52) using nested for loops:
On 4/9/09 Thu Apr 9, 2009 2:34 PM, ANJAN PURKAYASTHA
anjan.purkayas...@gmail.com scribbled:
I need a Bernoulli random number generator which takes as inputs: a value
for p(1) (probability of choosing a 1) and the number of trials and
outputs a series of 0s and 1s according to the model
On 4/15/09 Wed Apr 15, 2009 9:18 PM, Fatema M fsm1...@gmail.com
scribbled:
Hi,
I am facing an error while executing the Perl script, its compilation fails
with the following error
Can't call method execute_flow without a package or object reference
at addr
Code Snippet:
use
On 4/16/09 Thu Apr 16, 2009 1:39 PM, edw...@yandex.ru edw...@yandex.ru
scribbled:
Hello,
I would like to know, how to force perl unfold foreach expression during the
compilation, i.e. I want next code:
foreach (1..100) {
block
}
to be compiled like this:
block[$_ =
On 4/17/09 Fri Apr 17, 2009 10:02 AM, Brian brian5432...@yahoo.co.uk
scribbled:
Hi
I had this semi-working, changed something and can't remember where I
went right, so would appreciate some help getting back on top.
I know 1..10 and 2..10 probably won't work in the following example, I
On 4/16/09 Thu Apr 16, 2009 2:25 PM, Chas. Owens chas.ow...@gmail.com
scribbled:
2009/4/16 Jim Gibson jimsgib...@gmail.com:
snip
This calls the new method in package vpu and assigns the return value, which
should be a blessed scalar of some type, usually a reference to a hash, but
it could
On 4/17/09 Fri Apr 17, 2009 1:50 PM, Brian brian5432...@yahoo.co.uk
scribbled:
Brian wrote:
oops, should read..
$Year_out = $Year_in;
while ($Year_out 100) {$Year_out -= 100;}
if (($Year_out 00) ($Year_out = 25)) {$string = $string1;}
if
On 4/21/09 Tue Apr 21, 2009 8:58 AM, Grant emailgr...@gmail.com
scribbled:
I'd like to take a string and manipulate it in a few ways.
If the string is 34 characters or less, I'd like to append a colon
character and save it to $var1.
The length function will tell you how many characters
On 4/21/09 Tue Apr 21, 2009 10:46 AM, Grant emailgr...@gmail.com
scribbled:
Thanks guys. With some help I've come up with this:
$string = 'abc def ghi jkl mno pqr stu vwx yz';
if(length($string) = 34) {$var1 = $string.:;}
'=' is assignment, '==' is test for numerical equality. Change the
On 4/21/09 Tue Apr 21, 2009 11:16 AM, Grant emailgr...@gmail.com
scribbled:
$string =~ s/\s//g;
The above line deletes all of the spaces in $string. Is that what you want
to do?
All fixed up except for this. How can I remove only the spaces at the
end of $var1 and $var2 if they
On 4/21/09 Tue Apr 21, 2009 11:42 AM, Grant emailgr...@gmail.com
scribbled:
I'm trying to pull 35 or fewer characters to the nearest space
basically. This is what I have now:
if(length($string) = 34) {$var1 = $string.:;}
if(length($string) 34) {
($var1, $var2) = ($string =~
On 4/21/09 Tue Apr 21, 2009 11:54 AM, Grant emailgr...@gmail.com
scribbled:
if you have in $string = q[1234 12345 12 5346 12367 123 123678123];
Then $var1 will be '1234 12345 12 5346 12367 123 12367', but I thought you
wanted '1234 12345 12 5346 12367 123'?
Which one is the right one for
On 4/21/09 Tue Apr 21, 2009 3:27 PM, hOURS h_o...@yahoo.com scribbled:
Hi all,
The get function in the libwww-perl library would be really useful to
me, but I'm having problems making it work. When I use it in a
cgi script (it's ultimate destination) it fails. My browser
displays a
On 5/13/09 Wed May 13, 2009 4:48 AM, Michael Alipio
daem0n...@yahoo.com scribbled:
I have a c code that looks like this:
#includestdio.h
main (){
char girl[] = anna;
char boy[] = jude;
stringcopy(boy, girl); /* copy boy to girl */
printf(%s, girl);
}
void stringcopy(char *b,
On 5/13/09 Wed May 13, 2009 2:17 PM, ANJAN PURKAYASTHA
anjan.purkayas...@gmail.com scribbled:
Hi,
Here is a beginner's LWP code that is not working. The script is supposed to
query the NCBI website with a user defined term: tuberculosis. The term is
entered into a search box. The user
On 5/13/09 Wed May 13, 2009 4:48 PM, Steve Bertrand st...@ibctech.ca
scribbled:
Hi all,
I'm trying to push a scalar onto an array. The array I'm trying to
push() to is the first element of another array. I can't figure out what
I'm missing. It would be appreciated if someone could point
On 5/13/09 Wed May 13, 2009 11:03 AM, Vaishak vaishak...@gmail.com
scribbled:
Hello List,
I have a DOS batch file which has perl script that runs at the end. The perl
script fetches information from different files and database and generates
an excel file. Is there a way I can
On 5/27/09 Wed May 27, 2009 2:14 AM, Kelvin Philip
kelvinphi...@gmail.com scribbled:
Hi,
Is there any method to append a row to an existing Excel file? Can I do it
using the Spreadsheet::WriteExcel module?
The Spreadsheet::WriteExcel (SS:WE) module will not add data to an existing
On 5/27/09 Wed May 27, 2009 9:15 AM, Kirk Wythers kwyth...@umn.edu
scribbled:
Thanks David. I didn't include my attempts because the postgresql
stuff took up so many lines. I have snippet out the data read part
(including your suggestion) and pated below. As you can see I also,
sent a
On 5/27/09 Wed May 27, 2009 3:27 PM, Stephen Reese rsre...@gmail.com
scribbled:
List,
I've been working on a method to parse a PDF or TXT document and
output the results to XML over at Experts Exchange.
http://www.experts-exchange.com/Programming/Languages/Scripting/Perl/Q_2443963
0.html
On 6/1/09 Mon Jun 1, 2009 1:58 AM, practicalp...@gmail.com
practicalp...@gmail.com scribbled:
Hello,
What's the standard way to calculate a subroute's executed time in Perl?
Thanks in advance.
One popular way is to use the Benchmark.pm module.
See 'perldoc Benchmark' or
On 6/1/09 Mon Jun 1, 2009 1:40 PM, Ravi Malghan rmalg...@yahoo.com
scribbled:
Hi: I have web page built using perl cgi. Generated page has the following
element
div id=userName style=display: none; name=userName admin /div
Within the perl script is there a way to access the value of
On 6/9/09 Tue Jun 9, 2009 1:24 AM, Dave Tang d.t...@imb.uq.edu.au
scribbled:
Hello,
I have a problem, which I have put into an analogy.
Suppose a parent has 11 children. These children like chocolate. If 9 or
more of the 11 children from the same parent like a particular chocolate,
the
On 6/11/09 Thu Jun 11, 2009 1:51 AM, Michael Alipio
daem0n...@yahoo.com scribbled:
Hi,
I have a program that computes the number of elapsed minutes and seconds.
if the outputs are:
2 minutes, and 8 seconds.
How do I print those two values to look like Elapsed time: 02:08
This
On 6/11/09 Thu Jun 11, 2009 11:00 AM, Phillip fibbe...@gmx.net
scribbled:
Hallo @ all,
i am new in this domain(perlscript) and i have a question.i have a
array,i sort it,i get the last element of the array but i want to get
the next element after this one.how can i do this?
There is a
On 6/15/09 Mon Jun 15, 2009 12:26 PM, Thomas H. George
li...@tomgeorge.info scribbled:
I do not fully understand the solution to the problem, p77-78 237.
First, the declaration of the array my @files in the subroutine
gather_mtime_between will be read every time find($gather,
On 6/16/09 Tue Jun 16, 2009 9:14 PM, Rajini Naidu rajinid...@gmail.com
scribbled:
Hi,
I have the following code in my program.
use strict;
use warnings;
use diagnostics;
use Time::Local;
my @match_list;
my $days1 = ;
my $days2 = ;
my $day = ;
if ($failtag eq CompileErr)
On 6/19/09 Fri Jun 19, 2009 8:44 AM, Harry Putnam rea...@newsguy.com
scribbled:
Chas. Owens chas.ow...@gmail.com writes:
On Fri, Jun 19, 2009 at 09:35, Harry Putnamrea...@newsguy.com wrote:
How to manage a recursive chown using perl function chown?
Do I have to employ something like
On 6/24/09 Wed Jun 24, 2009 10:45 AM, Roman Makurin dro...@gmail.com
scribbled:
Hi
I need create a friend class. Is there any special that I
need to know ? For now, I get object and work with it like
with ordinary reference with direct access to internal
fields.
All Perl classes are
On 7/2/09 Thu Jul 2, 2009 12:12 PM, daem0n...@yahoo.com
daem0n...@yahoo.com scribbled:
Hi,
If I have a loop that for each run creates
while (FILE){
my $value =~ /^\d/;
$myhash{$mykey}-{'subkey'} = $value;
}
Normally, if I only want to sort $myhash through it's values, I
On 7/6/09 Mon Jul 6, 2009 3:19 PM, Emanuele Osimo e.os...@gmail.com
scribbled:
Hello there,
I'm a biologist and I'm trying to start using bioperl for bioinformatic
purposese but I've never programmed.
Could you suggest me something to read to start from 0 level?
See the FAQ 2 for Perl. Try
of code which load the module in my caller are these:
use lib 'Mod';
use Mod::myMod;
The line of code where I get the error is this:
my $obj = myMod-new();
Try this line instead:
my $obj = Mod::myMod-new();
--
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr
On 7/10/09 Fri Jul 10, 2009 11:32 AM, Matteo Riva mura...@gmail.com
scribbled:
Hello everybody, I have two lists and I want to merge them like this:
element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc.
I need this to create a sequence of key/value for an anonymous hash.
On 7/10/09 Fri Jul 10, 2009 12:37 PM, Steve
steve.h...@digitalcertainty.co.uk scribbled:
Hi list memebers. I'm new here and I'm interested in learning about
Perl. I've managed to get some programs together but have a lot to
learn.
May I put a question to the experts?
Suppose I have a
On 7/10/09 Fri Jul 10, 2009 2:25 PM, Shawn H. Corey
shawnhco...@gmail.com scribbled:
On Fri, 2009-07-10 at 15:19 -0600, Scott wrote:
Hello,
Here is my code on the perl side:
my @wall_data = ();
while(my $wallref = $wallpostquery-fetchrow_hashref())
{
my %walldata;
the fact and read a
line from the file with the lessor of the two line, alphabetically
speaking, then compare again.
--
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
number of digits using printf and the format
descriptor %.mf, where m is the number of
digits you want. If you actually need more than
64 bits (and you probably don't), then use
Math::BigFloat and suffer the performance penalty.
--
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr
On 8/7/09 Fri Aug 7, 2009 8:03 AM, jet speed speedj...@googlemail.com
scribbled:
Hi,
I would like to join the $abc with ':' the final desired output 1:2:3:4:5
#!/usr/bin/perl
use strict;
use warnings;
my $abc = 1 2 3 4 5;
my $out = join ':', $abc;
print $out;
executing the
On 8/27/09 Thu Aug 27, 2009 10:42 AM, Ian pcs...@gmail.com scribbled:
Pure beginners question.
I'm creating a hash of arrays like this :
$ihash{$3}{$1} = [...@itab];
For now I was able to get the data using Dumper but I need to create a
pretty report.
How do I loop over this
Excel on Windows? I would guess
that the latter is slower than the former, but I never compared the
two methods.
--
Jim Gibson
jimsgib...@gmail.com
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
At 7:22 PM -0700 9/2/09, Noah Garrett Wallach wrote:
Hi there,
what is the way to collapse this search/replace to one line?
my $filename_cmd = $cmd[-1];
my $filename_cmd =~ s/\s/\./;
(my $filename_cmd = $cmd[-1]) =~ s/\s/\./;
--
Jim Gibson
jimsgib...@gmail.com
'}{$2} = 1;
The rest looks OK, and compiles.
--
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
-of-hashes
will have and always use the appropriate amount of dereferencing.
Use the Data::Dumper module to print a multi-level data structure and
reveal its structure and contents:
use Data::Dumper;
print Dumper(\%policy);
--
Jim Gibson
jimsgib...@gmail.com
--
To unsubscribe, e
$/ },
@INC;
print join \n, @files;
--
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
);
}
This will not overwrite any data. You will probably have many one-element
arrays, however.
--
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On 9/24/09 Thu Sep 24, 2009 5:23 PM, Noah noah-l...@enabled.com
scribbled:
Hi there,
How do I use the glob command to handle ~?
I am getting file not found for something like ~/cvs/blah.pl
so this command dies with file not found:
open BBOUTPUT, $output_file or die $!;
to work, I suggest that you may
have a precedence problem in your call to the each routine. Try this line
instead:
while( my($key,$value) = each(%policy_Hash) ) {
Note the parentheses around $key,$value.
See 'perldoc -f each' for an example.
--
Jim Gibson
--
To unsubscribe, e-mail
) {
for my $key2 ( sort keys %{policy_Hash{$key1}} ) {
print $key1 = $key2 = $policy_Hash{$key1}-{$key2}\n;
}
}
This will only work if all values of the first-level hash are references to
a hash. Data::Dumper can handle the case where this is not true.
--
Jim Gibson
At 10:50 PM -0400 9/28/09, Steve Bertrand wrote:
xufengnju wrote:
Hi all,
I have a storage server that holds one million of images with well
structured directory structure such as
/data/user1/2008/09/12/image1.jpg
/data/user1/2008/09/12/image2.jpg
...
/data/user2/2009/01/01/image1.jpg
On 9/30/09 Wed Sep 30, 2009 11:33 AM, Bruce Ferrell
bferr...@baywinds.org scribbled:
Shawn H Corey wrote:
Bruce Ferrell wrote:
I have a database (mysql if it matters) and I can select columns and
rows from it no problem. what I can't quite seem to see how to do is to
take the columns
other array.
You can read about @ARGV and many other special Perl variables in the
'perlvar' section of the built-in Perl documentation, available from
a shell with
perldoc perlvar
--
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional
On 10/8/09 Thu Oct 8, 2009 9:00 AM, Raheel Hassan
raheel.has...@gmail.com scribbled:
Hello,
I have problems in understanding $...@$ use ?
1- my $ref = $$temp_sth - fetchall_arrayref({});
for(my $i=0; $i = $...@$ref}; $i++) {
For any array @a, the largest index is given by $#a.
On 10/8/09 Thu Oct 8, 2009 3:56 PM, Harry Putnam rea...@newsguy.com
scribbled:
Shlomi Fish shlo...@iglu.org.il writes:
Hi Harry!
[...]
I want to catch those long lines and format them like one might format
a news/mail message... wrapped at column 72 or so but also indented
a push equivalent for hash of hashes?
No. Unless each record has a unique key, you are better off using an
array of hashes, rather than a hash of hashes. Of course, you could
use the line number as a unique key, but an array would be more
efficient.
--
Jim Gibson
j...@gibson.org
On 10/9/09 Fri Oct 9, 2009 7:43 AM, Harry Putnam rea...@newsguy.com
scribbled:
I'm thinking of splitting on something like ' +' (spcspc+) since
no regular output will have 2 spc or more between connected
words I mean words that belong in a group.
I would use the construct /\s{2,}/ for
On 10/9/09 Fri Oct 9, 2009 2:12 PM, Noah noah-l...@enabled.com
scribbled:
Hi there,
I am trying to figure out why the following lines are giving me an error:
--- snip ---
$found{filter}{$filter}{family}{$family} = 1;
print keys %{
, then
standard input will be read to supply a list of file names. Therefore, you
can pipe the results of some command that generates file names, such as ls
or find, to rename:
ls *.dat | rename s/dat$/data/
--
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
At 5:45 AM +0200 10/18/09, adlai burman wrote:
Hello and help, please.
This is actually a CGI/Perl issue I am having but Perl seems to be the
closest forum here.
I am having a very simple (hence very frustrating) problem with a CGI/
Perl script. For some reason if I pass things from a checkbox
lines except for the last twelve, and write the
lines to the new file. No modules required, and no file copying
either.
Since bash history files are that big, you could also read the file
into an array, get the number of elements in the array, and write out
the array accordingly.
--
Jim
On 10/19/09 Mon Oct 19, 2009 11:38 AM, Harry Putnam rea...@newsguy.com
scribbled:
I'm not sure what it is about the tail -f command that allows it to
keep reading over restarts of system logger (on Opensolaris)... but
how can I emulate whatever it is.. in perl?
There is an FAQ:
At 9:35 AM +0800 10/21/09, Majian wrote:
Dear list:
I have a question on learning Perl . Please give me a help .
The problem is :
How can I split a string into chunks of size n bytes?Like this :
#!/usr/bin/perl
my $string = 1234567890abcdefghijABCDEFGHIJK;
my $n = 2;# $n is group
At 3:59 PM -0700 10/20/09, cerr wrote:
Hi,
I wanna execute an external bash command but timeout if it's taking
longer than XX seconds. I've tried it like this:
eval {
local $SIG{ALRM} = sub {die alarm\n};
alarm $timeout;
$test = `$sshpassPATH . -p .$clientpw. ssh
At 8:52 PM +0800 10/21/09, Majian wrote:
Hi, all ;
I want to print this sentence The number in scientific
notation is 1.255000e+02.
So I write a perl script like this :
#!/usr/bin/perl
sprintf The number in scientific notation is %e,
to the files in the temporary
folder. Make sure your browser will download that type of file.
Try just typing in a URL in your browser that points to your
temporary folder. If you are lucky, you will get an index of the
files in that directory and be able to download any of them.
--
Jim Gibson
At 11:21 AM +0530 10/23/09, pradeepkumar.sura...@wipro.com wrote:
Hi,
The contents in my array looks like this...
change_id=B77_ip_sync_idl state=released customer_rel=B77
change_name=ip_vke_sync short_description=This feature introduces the
Sync idl. planned_baseline=B77_135.00
At 4:02 PM -0500 10/24/09, Harry Putnam wrote:
With this little script, how would I manage to get the shorter
timestamps zero padded using printf? I now how to get padded numbers
but not when I'm pushing off the right margin too.
cat script.pl
#!/usr/local/bin/perl
use strict;
use
At 3:57 PM -0500 10/24/09, Harry Putnam wrote:
Sorry about being tricky with what was an older thread. But I suspect
that thread died... and no one noticed there was an unaswered question
still there.
Or no one knew the answer.
Shawn C originally suggested I use File::Tail. There was a
On 10/26/09 Mon Oct 26, 2009 8:57 AM, Bryan R Harris
bryan_r_har...@raytheon.com scribbled:
Is there a good way to do printf's with currency symbols?
I've tried this:
printf Total: \$%10.2f\n, $total;
But it puts the dollar sign way out front (ugly). I want it to look like:
On 10/26/09 Mon Oct 26, 2009 8:45 AM, Michael Alipio
daem0n...@yahoo.com scribbled:
Thanks for the advice. Forgive me if I sounded like someone who's frustrated,
couldn't do his homework asking somebody else for help.
When I was learning C programming, I read that learning those difficult
On 10/28/09 Wed Oct 28, 2009 9:37 AM, Harry Putnam rea...@newsguy.com
scribbled:
What follows is snippet out of a more complex script and reworked to
simplify but still not seeing what causes the problem.
I'm not sure if I've just stared at it too long or what. When I run it
I get this
On 10/28/09 Wed Oct 28, 2009 10:43 AM, Harry Putnam rea...@newsguy.com
scribbled:
Jim Gibson jimsgib...@gmail.com writes:
We need to know what you are trying to accomplish here.
Its over 300 lines of code at this writing.
Well we definitely do not want to see all 300 lines. However
On 10/28/09 Wed Oct 28, 2009 12:55 PM, Harry Putnam rea...@newsguy.com
scribbled:
Looking over the perldoc File::Find output (perl 5.8.4)
I see at finddepth it says:
[...] in part
finddepth() works just like find() except that is invokes the
wanted function for a
On 10/28/09 Wed Oct 28, 2009 3:00 PM, ANJAN PURKAYASTHA
anjan.purkayas...@gmail.com scribbled:
Trying to learn how to run Gnuplot via a Perl script I came across the
following helpful example:
#!/usr/bin/perl
# Generate postscript and png plot with GNUplot from Perl
# Author: Ioan Vancea
On 10/28/09 Wed Oct 28, 2009 3:18 PM, Harry Putnam rea...@newsguy.com
scribbled:
Jim Gibson jimsgib...@gmail.com writes:
If you want to process files in a certain order, then save the files in an
array. When find is finished, sort that array and process the files in any
order. For example
1 - 100 of 723 matches
Mail list logo