Mike Blezien [MB], on Monday, January 30, 2006 at 08:30 (-0600) typed
the following:
MB> I have the two files aboved installed but get this error when running the
MB> wethumb script from the command line:
MB> pnmscale: EOF / read error reading magic number
MB> pnmtojpeg: EOF / read error reading
Mike Blezien [MB], on Monday, January 30, 2006 at 07:44 (-0600) made
these points:
MB> bash: pnmscale: command not found
MB> bash: pnmtojpeg: command not found
I never tried this utility, but know about that, if you get some
thumbnails from it, let us know. For those commands not found, it easy
t
Hi all there,
I'd like to use %subj% with caching options. I know how to use
Cache::File; or WWW::Mechanize::Cached.
Problem comes, when I want to cache webpage with forms (POST).
I decide not to use WWW::Mechanize::Cached, because it uses as key
given URL (as I decoded that from source).
I know
Dhanashri Bhate [DB], on Tuesday, December 20, 2005 at 17:53 (+0530)
wrote the following:
DB> If I do as you have mentioned above, $mech-success is False. ( $mech->get
DB> expects a url )
DB> I tried to get the complete the URL by concatenating the $imageref->base and
DB> $imageref->url. And then
Dhanashri Bhate [DB], on Tuesday, December 20, 2005 at 16:51 (+0530)
thinks about:
DB> I am currently automating some UI tests with the help of WWW::Mechanize
DB> module.
DB> I need to save images on a webpage.
DB> print "Found the image, reference is : $imageref\n";
if you have URL in $imag
Brahadambal S [BS], on Tuesday, December 20, 2005 at 13:48 (+0530)
made these points:
BS> Could anyone tell me how to execute a .bat or .exe file
BS> through Perl? i.e, the perl code should invoke the executable.
BS> Thanks so much for your help(in advance).
if you are newbie, good hint is using
Andrej Kastrin [AK], on Monday, December 19, 2005 at 13:13 (+0100)
thinks about:
AK> So, following code split each line and print it.
AK> while (<>){
AK> @column = split(/\t/,$_); # split current line, field separator set
AK> to tab
AK> print OUTPUT "$column[0]\t$column[1]\tt$column[2]\n"
Andrej Kastrin [AK], on Monday, December 19, 2005 at 10:41 (+0100)
typed:
AK> 1 BRCA3 BRCA33|BRCA55 symbol 998
AK> 2 ABCB1 DASH|BASG|AVGA4 symbol 7583
AK> In first step I split each row and store it in array; e.g.:
AK> @array=( '1', 'BRCA3', 'BRCA33|BRCA55', 'symbol998')
Hi all,
I unpack some files in my script with external unpacker
(unrar, unzip, unarj, unace...). But some files are passworded, to
continue in script I have to press some key. It is some easy way how
to do this ?
I am think about eval and alarm...
/brano
--
To unsubscribe, e-mail: [EMAIL PROT
vinay mohan [vm], on Tuesday, December 13, 2005 at 19:57 (+0530)
wrote:
vm> HOW CAN I APPEND DATA TO AN EXISTING EXCEL FILE OR MODIFY THE DATA
vm> PRESENT IN THE EXCEL FILE
Hello to you too! Are you angry to us?
What did you tried, where did you searched, show us some code.
P.S.: search.cpan.or
Hello all,
on web page I want to have subscribers for emails (there will be rss
export too...), what is new, and so on.
So I think, it would be nice to use some mail list manager.
In DB I have emails, where to send, I will create message, use local
SMTP and so on.
But problem is with undeliverabl
Alexandre Checinski [AC], on Monday, December 12, 2005 at 11:10
(+0100) wrote:
from head:
my $string = '';
my ($id, $name) = $string =~ /id="(\d+)".*?name="([^"]+)"/;
AC> PS: I'm a total newbie...
you should learn regexpes, they are very powerful.
perldoc perlre
For parsing XMl files use some
Dr.Ruud [DR], on Friday, December 9, 2005 at 12:45 (+0100) wrote:
DR> #!/usr/bin/perl
thanks a lot Dr.Ruud (not Dr.Perl?:)). It works like a charm.
I completely forget to [^morecharacters] idiom.
--
How do you protect mail on web? I use http://www.2pu.net
[I am Ryu of Borg: The pronunciation
Hi all,
I need small regexp help, I'm doing webpage, where I rewrite all links
in XML according weblang parameter.
So we have for example in XML (I have it in scalar variable):
Foo and Bars Link='http://example.com/' Foo and Bars
Foo and Bars Link='http://example.com/#anchor' Foo and Bars
Foo and
Jennifer Garner [JG], on Thursday, December 8, 2005 at 19:21 (+0800)
typed the following:
JG> Sorry, the file is more than 900M, too large to download.
JG> I have run it for one day,and still have nothing to output.Crying...
JG> I think maybe some arithmetic is useful for me,and now I'm thinking o
Jeff 'japhy' Pinyan [JP], on Tuesday, November 29, 2005 at 09:12
(-0500 (EST)) wrote the following:
Jeff, Perl6::Form is so powerful. But I can't find how to properly do
this:
I have values:
('Name','Branislav');
('Surname','Gerzo');
And I'd like to print:
|Name: Branislav
Jeff 'japhy' Pinyan [JP], on Tuesday, November 29, 2005 at 09:12
(-0500 (EST)) thoughtfully wrote the following:
>> I'd like to know if there is module for following:
JP> Yes, Perl6::Form. It's a Perl 5 implementation of Perl 6's formats.
sometime is better ask, than DIY. Thanks a lot Japhy, thi
Hello all,
I'd like to know if there is module for following:
We have text:
=== IN ===
This is just small sentence about nothing.
=== IN ===
And I like to format it as follows:
112
12345678901234567890
=== OUT ===
| This is just |
| small sentence |
| about nothing. |
==
[EMAIL PROTECTED] [WPF], on Monday, November 21, 2005 at
15:59 (-0600) typed:
you have that in that faq. So try again:
$out = `echo this should work, nah`;
--
How do you protect mail on web? I use http://www.2pu.net
[We really don't care how Michael does it in Hollywood!]
--
To unsubscrib
Ing. Branislav Gerzo [IBG], on Tuesday, November 22, 2005 at 13:42
(+0100) thinks about:
IBG> while(my $tag = $parser->get_tag('b')) {
IBG> my $text = $parser->get_text();
IBG> last if $text =~ /^(this and that|or that and this)/i;
IBG> }
IBG>
Hello all,
I'm using this great module for parsing HTML files. But I run into
trouble - I need get clear unchanged HTML code. Common example of
using this module is (snippet):
while(my $tag = $parser->get_tag('b')) {
my $text = $parser->get_text();
last if $text =~ /^(this and t
Ing. Branislav Gerzo [IBG], on Monday, November 07, 2005 at 13:27
(+0100) has on mind:
IBG> use IO::Socket::SSL; #it is installed
when I delete ^^ this one, and write:
use Crypt::SSLeay;
everything works. strange :)
--
How do you protect mail on web? I use http://www.2pu.net
[Brains are
Hi all,
i have a little problem, I use my favourite WWW::Mechanize to download
webpages and so on, but I came to one problem:
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
use IO::Socket::SSL; #it is installed
my $mech = WWW::Mechanize->new();
$mech->agent_alias( 'Windows IE 6' )
Ricardo SIGNES [RS], on Wednesday, November 2, 2005 at 09:24 (-0500)
wrote the following:
RS> my %occurances; # we'll put occurances here
RS> while (<>) {# get each line of argument files (or sdin)
RS> chomp;# eliminate the newline
RS> my @wo
Hi all,
I have quite interesting work. Example:
In txt I have some words (up to 100.000) - words.txt (without line
numbers):
1. foo
2. bar
3. foo bar
4. foo bar bar
5. bar foo bar
6. bar bar foo
7. foo foo bar
8. foo bar foo bar
9. foob bar
10.foo bars
and so on...
Now, I have to find all 2 wor
Jeff 'japhy' Pinyan [JP], on Thursday, October 20, 2005 at 09:34
(-0400 (EDT)) wrote about:
JP> Stop right there! See the [ at the beginning of the dumped representation
JP> of $response? That means $response is an array reference. It *holds*
JP> objects, but it isn't an object itself.
yes, th
Hi pals,
I have this naughty problem, and I am stuck:
use strict;
use warnings;
use Net::Google;
use constant LOCAL_GOOGLE_KEY => "mykey";
my $service = Net::Google->new(key=>LOCAL_GOOGLE_KEY);
my $session = $service->search();
$session->query(qw(Perl modules));
my $response = $session->respo
Wiggins d'Anconia [Wd], on Tuesday, September 27, 2005 at 17:51
(-0600) contributed this to our collective wisdom:
Wd> You haven't shown us what you have tried, or where it failed, only
Wd> suggested something about eval and recursive subs, which neither of
Wd> which should be pertinent here. Show
Hi Perlers,
I have one nice question for you, I was run into common problem:
need to repeat certain number of times something, until is succesful.
For example - download webpage, FTP upload, connect to some host and
so on.
I ask you for some general (or it can't be possible - FTP upload)
function,
Hi all,
recently I've updated perl on FreeBSD machine to latest, but my
modules go away, they are not in @INC. I have 2 questions:
1. is there possibility update perl, without modules going away?
2. I have some perl CGIs on server, now I have 500 internal server error
because some modules are m
David Foley [DF], on Thursday, July 14, 2005 at 15:41 (+0100) has on
mind:
[we don't know]...
David, we all get (I think) only 3 pictures in your mail; if you
could, stop sending this (pictures). But main problem is we don't get
any text, any question in your mail, so we can't answer.
Try to fix
Beast [B], on Thursday, July 14, 2005 at 18:23 (+0700) typed the
following:
B> Is it possible to limit memory used by perl? I don't want perl program
B> to eat all memory causing OS to freeze.
I think, one way how to limit memory usage by perl is measure its
memory, you didn't write you OS, so he
Thomas Bätzler [TB], on Wednesday, July 13, 2005 at 12:38 (+0200) made
these points:
>> that - for example - Begin and end with an "G"
TB> while( $line =~ m/\W((g\w*?)|(\w*?g))\W/ig ){
this will print OR, he wants AND, so, change this regexp to:
m/\W((g)\w*\2)\W/ig
--
How do you protect mail
Jorge Almeida [JA], on Tuesday, July 12, 2005 at 09:23 (+0100 (WEST))
thoughtfully wrote the following:
>> Rounding in financial applications can have serious implications, and
>> the rounding method used should be specified precisely. In these cases,
>> it probably pays not to trust whichever sys
Jorge Almeida [JA], on Tuesday, July 12, 2005 at 08:26 (+0100 (WEST))
typed:
JA> Is there some way to really round a number to a given number of digits
JA> after the point?
JA> For example (1 digit):
JA> 12.3 --> 12.3
JA> 12.34 --> 12.3
JA> 12.35 --> 12.4
JA> 12.349
Gomez, Juan [GJ], on Monday, July 11, 2005 at 10:16 (-0500) typed:
GJ> I been hearing about hash on perl
GJ> can someone tell me a little bit about that and if you could add a example
GJ> it would be very nice from you thank you
I hear about google. Could you tell me, if you too? What about to s
Nan Jiang [NJ], on Friday, July 08, 2005 at 11:15 (+) has on mind:
NJ> My statement is below:
NJ> $dbh->do("INSERT INTO table1 values(id, '$_', '$t')") foreach sort keys
NJ> %temp;
you really should read guide for database statements, this is not way
how to do these things.
for example:
ht
Tielman Koekemoer (TNE) [TK], on Tuesday, July 5, 2005 at 12:15
(+0200) wrote these comments:
TK> I have done some tests and it seems there is no difference in
TK> performance with or without defined(). When should defined() be used
TK> then if it makes no difference?
did you tried:
$hash{val} =
Vineet Pande [VP], on Monday, July 04, 2005 at 20:34 (+) wrote:
VP> what I don't understand is how the block functions here: we did not define
VP> $a and $b? Also I donot understand this kind of block usage.
when you don't know something, try ask perl:
perldoc -q sort
if you find (or know)
Mads N. Vestergaard [MNV], on Monday, July 04, 2005 at 19:25 (+0200)
wrote the following:
MNV> My string is "footest test testbartest test
MNV> testbaztest test test".
I hope this snippet will help you:
use strict;
use warnings;
my $string = qq{footest test testbartest test
test
Daniel Brown [DB], on Monday, July 4, 2005 at 15:26 (+0100) wrote
about:
DB> Now I am wanting to analyze log files with Perl and dump the results in
DB> a MySQL database. I know I want the DBI and DBD-MySQL modules and I've
DB> already downloaded them but what files do these modules consist of at
lohit [l], on Monday, July 4, 2005 at 13:21 (+0530) contributed this
to our collective wisdom:
l> lets assume I call the function as show below
l> func("arg1","arg2","this is arg 3", "this is arg 4");
l> now inside func function how do I retrieve my arguments
l> sub func()
l> {
l> foreach $arg
N. Ganesh Babu [NGB], on Monday, July 04, 2005 at 12:32 (+0530) typed
the following:
NGB> $line=~s!\(([1-9]{1,3}((,
NGB> |\\p=n-\\)[1-9]{1,3})*)\)!\(@{[map"$_",split"(,
NGB> |\\p=n-\\)",$1]}\)!g;
NGB> I am getting the following error:
NGB> Unmatched ( in regex; marked by <-- HERE in m/( <-- HE
[EMAIL PROTECTED] [dwt], on Sunday, July 3, 2005 at 15:04
(+0100) wrote about:
dwt> : PRIVMSG <#channelname> :
dwt> At the moment I am using the if statement:
dwt> if($input =~ /m*PRIVMSG*:/i)
dwt> , but it is never true.
if message looks like this:
:somewhere.host.com PRIVMSG #channel : message
Moon, John [MJ], on Friday, July 1, 2005 at 11:30 (-0400 ) contributed
this to our collective wisdom:
MJ> I would have "assumed" that /var/run would NOT be "like" /var/ru just as
MJ> /var/run is not "like" /var/ra...
is "/var/ru" at the beginning of "/var/run" ? yes.
--
...m8s, cu l8r, Brano
[EMAIL PROTECTED] [DD], on Wednesday, June 29, 2005 at 06:39
(-0400) contributed this to our collective wisdom:
DD> open(INPUT, "rrd_input.txt");
DD> open(OUTPUT, ">rrd_update.cmd");
use 'or die $!;'
DD> while (INPUT)
DD> {
DD> ($ServerName,$DS,$Time,$Value) = Split (/\T/,$Data,4);
split(
Shilpa Arvind [SA], on Tuesday, June 28, 2005 at 12:12 (-0700) wrote:
SA> What does \" do. (Quotes) " does not require blackslash but here it is used
SA> with blackslash. What does this do.
regular expression should be written as '\"' or '"'. In this case ("
is not a special character), should be
bright true [bt], on Sunday, June 26, 2005 at 13:37 (-0700)
thoughtfully wrote the following:
bt> anybody could give me some help on how to use mysql with Perl
bt> anything would help URLS , Examples etc...
bt> i searched and i found ... but it was incomplete examples
you searched wrong. Ok,
Bret Goodfellow [BG], on Wednesday, June 22, 2005 at 15:55 (-0600)
wrote these comments:
>This is what I actually did to resolve my issue:
>@words = split(/ * /, $line)
>Print "the third word is: $words[2]\n";
this is not good, you don't know about regexpes much, eh?
first argument in split is //
Chris Devers [CD], on Wednesday, June 22, 2005 at 17:53 (-0400 (EDT))
wrote the following:
CD> my $fields = split( /\s+/, $record );
CD> my $fourth = $fields[3];
CD> This problem doesn't require any looping! :-)
I, know, thats just example.
I read whole the message, in original was:
"I want
Bret Goodfellow [BG], on Wednesday, June 22, 2005 at 15:11 (-0600)
typed the following:
BG> All right, I know how to do this in REXX because there is a word()
BG> function, but how do I do this in Perl. I want to read in one record at
BG> a time, that has space-delimited fields. There may be mul
Xavier Noria [XN], on Tuesday, June 21, 2005 at 18:31 (+0200) thinks
about:
XN> What about doing and split first on the whole text and then use array
XN> slices?
not bad idea, will try to play with that, it is easier for this task
as while regexp loop
--
...m8s, cu l8r, Brano.
[If you cant f
Hello all,
I have
$text = '(this) is just really small test.';
in loop I want get all 2-words and 3-words:
2 words:
(this) is
is just
just really
really small
small test.
3 words:
(this) is just
is just really
...and so on
This is not a big deal, 2 words I did with:
while ($text =~ /(?=(\S+\s
Owen [O], on Tuesday, June 21, 2005 at 14:56 (+1000) typed the
following:
O> my $text = '/data/PerlScripts/test.txt';
this is your text you'd like to convert, or it is textfile, where you
have content you'd like to convert ? I think the 2nd option is right,
so you need to:
my $file = '/d
John W. Krahn [JWK], on Saturday, June 18, 2005 at 12:11 (-0700)
typed:
JWK> $ perl -le'
JWK> my $first = 'B';
JWK> my $second = 'a';
JWK> ( $first, $second ) = map lc eq $_ ? uc : lc, ( $second , $first );
JWK> print for $first, $second;
JWK> '
JWK> A
JWK> b
thanks John, nice solution, but if
Elvis Cehajic [EC], on Saturday, June 18, 2005 at 19:11 (+0200) wrote:
EC> Like that?:
EC> use strict;
EC> use warnings;
EC> my $first = 'B';
EC> my $second = 'a';
EC> ($first, $second) = (uc($second) , lc($first));
EC> print $first, "\n";
EC> print $second, "\n";
sorry, I was not clear. I d
Hi all,
quite interesting, how you would write this without $temp:
use strict;
use warnings;
my $first = 'B';
my $second = 'a';
($first, $second) = ($second , $first);
print $first, "\n";
print $second, "\n";
but I want keep case of chars, so output is:
"Ab"
Have a nice day :)
--
To unsub
Ing. Branislav Gerzo [IBG], on Tuesday, June 14, 2005 at 21:10 (+0200)
thinks about:
IBG> my ($id) = $dbh->selectrow_array("select id from
IBG> db_url where id = ?", {}, $url);
ahm, maybe I'm too tired or blind, don't see that - I have error in
select state
Hi all,
I'm using MYSQL, and have this weird problem, here is self-explaining
snippet:
sub save_url {
my $url = shift || die "Need url!";
my ($id) = $dbh->selectrow_array("select id from db_url where id = ?",
{}, $url);
unless ($id) {
my $sth = $dbh->prepa
Ron Smith [RS], on Saturday, June 11, 2005 at 14:11 (-0700 (PDT)) has
on mind:
RS> Does Perl have the equivalent of a case statement or a switch
RS> statement. I'm trying to avoid a bunch of "if-then" statements.
RS> I'm seeing posts regarding "use switch", but I want to make sure
RS> it's not a d
Toby Stuart [TS], on Wednesday, June 8, 2005 at 16:47 (+1000 ) made
these points:
TS> Before: $s = "abc@123";
TS> After : $s should only contain: "abc@123"
TS> I've tried a few things with ranges etc. but can't get it. Obviously I
TS> could check if the number is <= 29 and then replace but would
Offer Kaye [OK], on Tuesday, June 7, 2005 at 17:04 (+0300) contributed
this to our collective wisdom:
OK> There's no need to escape metachars in the replacement part. Without
OK> modifiers (such as "e" or "x") the replacement part is treated as a
OK> simple double-quoted string (delimiter dependen
Octavian Rasnita [OR], on Tuesday, June 7, 2005 at 13:01 (+0300) wrote
about:
OR> I had the same problem and I don't know why, but I have discovered that if I
OR> don't use $sth->fetchall_hashref('key') but another method, the script
OR> doesn't gives errors anymore.
OR> So I needed to use fetchro
Hi all,
I get error:
Attempt to free unreferenced scalar: SV 0x1e166a0, Perl interpreter: 0x3417c at
D:/Perl/lib/Errno.pm line 15.
while running this script, could anybody helps me ?
use strict;
use warnings;
use DBI;
use WWW::Mechanize;
my $dbh = DBI->connect("DBI:mysql:database=test;host=local
Thomas Bätzler [TB], on Monday, June 6, 2005 at 12:07 (+0200 )
contributed this to our collective wisdom:
TB> What happens is that your page has javascript: links embedded.
TB> URI.pm tries to load URI::javascript, but it's not there. Since
TB> URI.pm considers this a non-fatal error, it does not
Thomas Bätzler [TB], on Monday, June 6, 2005 at 11:01 (+0200 ) wrote
the following:
TB> Doesn't that kind-of answer your question?
TB> If you call die without an argument, it'll use the message in
TB> $@ instead. That's set by the last eval() in your code. I would
TB> expect that failing eval() h
Randal L. Schwartz [RLS], on , , 2005 at 05:47 (-0700) wrote about:
RLS> $wanted ||= $input =~ /$_/ for @filter;
RLS> $wanted;
RLS> } @input;
RLS> Note the use of ||= for short-circuiting the tests once a good filter
RLS> is found. You can't use "return 1", because a grep/map bl
Offer Kaye [OK], on Monday, June 6, 2005 at 10:31 (+0300) contributed
this to our collective wisdom:
$mech->get( 'http://www.google.com/' );
OK> So the problem is:
OK> 1. In some other code you didn't show
OK> 2. Specific to your OS, Perl version of W::M version
OK> I suspect reason 1 is the culpr
Hi all,
I noticed strange behavior with die;
Here is snippet:
use strict;
use warnings;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->agent_alias('Windows IE 6');
$mech->get( 'http://www.zoznam.sk' );
for my $link ( $mech->links() ) {
print $link->url_abs, "\n";
}
Peter Scott [PS], on Sunday, June 05, 2005 at 05:38 (-0700) has on
mind:
PS> Note that the /s is pointless there; there is no . in the regex.
umm, s/s/m/ ? :)
--
...m8s, cu l8r, Brano.
["If you don't pay the exorcist, are you Re-possessed??"]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Hi all,
let's we have:
use strict;
use warnings;
my @input = qw{ one two twentythree four };
my @filter = qw { one three five ten twenty };
my @filtered = ();
for my $in (@input) {
for my $filter (@filter) {
push @filtered, $in if $in =~ /$filter$/i;
}
}
I'd like to get new @f
Zeng Nan [ZN], on Sunday, June 5, 2005 at 16:20 (+0800) contributed
this to our collective wisdom:
ZN> I'd like to convert a text file to tex. One thing I encounter is that
ZN> there are lots of dialogues, and I want to transform " " to `` ''
ZN> properly. I try to use s/"([^"]*)"/``$1"/gs but it
Hi all,
I'd like to create one project and I ask you for help/comments.
I'm making test search engine, but first, I have to download/store webpages
So the main question is:
what I should use to paralell (multi-thread) download and store source
of htmls to mysql db ?
I thought about:
1. Parallel::
Jeremy Vinding [JV], on Friday, June 03, 2005 at 13:31 (-0600) typed
the following:
>>>Can I write a pattern that matches "Tampa" or "Florida", or "Tampa
>>>Florida"?
JV> you could also do:
JV> /(?:Tampa? Florida)|Tampa/
this will not match Florida, I think you meant:
/(?:Tampa )?Florida|Tampa/
Octavian Rasnita [OR], on Thursday, June 2, 2005 at 13:59 (+0300) made
these points:
>> good luck with Net::SFTP under windoze. If you will have problems,
>> just look to thread: mid:[EMAIL PROTECTED]
OR> Can you tell me how to read the page with that thread?
you can put that into google "[EMAIL
Brent Clark [BC], on Thursday, June 02, 2005 at 12:33 (+0200)
contributed this to our collective wisdom:
BC> Im trying to get the numbers before the hyphen
BC> e.g.
BC> 75664545-bookings
BC> Can I use index() for this ?
yes, you can use index for find index of "-" and after using substr to
extra
Hi all,
I get data from DB with:
while (my ($id, $post_text) = $getpost->fetchrow_array) {
is there a way how much columns are selected wihout select (fetch)
them all, or using count(*) function ?
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROT
Paul Johnson [PJ], on Wednesday, May 25, 2005 at 12:21 (+0200) made
these points:
>> @array = sort @array;
PJ> Using each will also affect the iterator.
hm.
PJ> I suggest changing the the previous code so it doesn't care what happens
PJ> to the iterator. For example:
PJ> my @keys = keys %hash
Hi beginners@perl.org,
anyone has better idea how to sort hash by key without using keys()
function? (I can't use it, it resets iterator...).
my bruteforce looks:
use strict;
use warnings;
my %hash = (1 => 'one',
2 => 'two',
3 => 'three'
);
my @array = ();
w
Tielman Koekemoer (TNE) [TK], on Wednesday, May 25, 2005 at 10:32
(+0200) typed the following:
TK> $file$num = $line; # Problem assignment!
use hash instead scalar variables; $file{$num} is OK.
First you have to ofcourse declare it: my %file = ();
--
How do you protect mail on web? I
Hi beginners@perl.org,
hello, very common problem is delimite some strings at certain words,
lets say:
$string = "this is some small test";
Now, we define, the longest $string2 could be 10 characters, and
$string we could delimite only on spaces and optionally punctation
(not on characters).
I'm
Xavier Noria [XN], on Tuesday, May 24, 2005 at 22:12 (+0200) typed the
following:
XN> my $i = 0;
XN> my @bar = map $_->[1], # take second component
XN>grep $_->[0] eq 'e', # let 'e's pass
XN>map [$_, ++$i],# arrayref [char, index of cha
Offer Kaye [OK], on Wednesday, May 25, 2005 at 09:09 (+0300) typed the
following:
>> it was easy mistake, everything we should know about this is avoid
>> using keys() on %$hr in while loop, because it resets iterator. That's
>> all.
OK> Well, that, and don't change the hash inside the while loo
Charles K. Clarkson [CKC], on Tuesday, May 24, 2005 at 08:16 (-0500)
thinks about:
CKC> It would be helpful to know what $hr looks like. Do this, and then
CKC> show us what it looks like. Show a partial dump if this is too long.
CKC> use Data::Dumper 'Dumper';
CKC> print Dumper $hr;
in select
Hi beginners@perl.org,
I fetch results from table with fetchall_hashref, here is my snippet:
my $hr = $get->fetchall_hashref('id');
while (my ($id, $value) = each(%$hr)) {
get_something();
}
sub get_something {
foreach my $k ( reverse sort { $hr->{$a}{counter} <=> $hr->{$b}{counter} }
Ing. Branislav Gerzo [IBG], on Friday, May 20, 2005 at 09:24 (+0200)
thinks about:
IBG> I'd like to create over 10.000 *.lnk files. I didn't find any module
IBG> for this, could someone help me ? (it could be also commandline
IBG> utility ofcourse).
IBG> Also anyone knows
Ankur Gupta [AG], on Friday, May 20, 2005 at 14:37 (+0530) wrote the
following:
AG> BEGIN {
AG> $SIG{__WARN__} = sub{ print STDERR @_; exit 1};
AG> }
AG> warn "I am going to die\n";
AG> I hope you are looking for something like this.
thanks a lot, this is exactly what I wanted.
--
How d
Hello beginners@perl.org,
it is possible to setup somewhere, I want my script dies, if warning
occurs.
Thanks
--
--. ,-- ,- ICQ: 7552083 \|||/`//EB: www.2ge.us
,--' | - |--IRC: [2ge](. .),\\SN: 2ge!2ge_us
`+==+=+===~ ~=-o00-(_)-00o-==
Hi beginners@perl.org,
I'd like to create over 10.000 *.lnk files. I didn't find any module
for this, could someone help me ? (it could be also commandline
utility ofcourse).
Also anyone knows, if it is possible to create *.lnk files relative to
original file? ("../../abc/orig.exe")
Thanks for an
Manish Sapariya [MS], on Wednesday, May 18, 2005 at 11:12 (+0530)
typed:
MS> Thats really neat way of writing the expression I was looking for.
MS> But somehow I couldnt get the following compiled. It says
heh, ok, this will work:
#!/usr/bin/perl
use strict;
use warnings;
my $a="1: 192.168.0.18
Manish Sapariya [MS], on Tuesday, May 17, 2005 at 17:38 (+0530) has on
mind:
MS> echo "1: 192.168.0.180:32866 - 192.168.0.183:143 (a2b)
MS> 17> 14< (complete)" | perl -lane 'print$_;if($_ =~
MS> /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5}) -
MS> (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5
Frank [F], on Monday, May 16, 2005 at 21:34 (+0800) wrote the
following:
F> How to determin whether I reach the end of file in Perl program? Also
F> , can you tell me where I can get these informations . I scan the
F> "programing perl " by Larry Wall, But it is diffculty to find what I
F> wa
Frank [F], on Sunday, May 15, 2005 at 19:45 (+0800) typed:
F> If i know the element of array, can I get the numeric index of this
F> element?
Exist a way, but it is better using hash. In arrays you have to
iterate over every element.
--
...m8s, cu l8r, Brano.
[Thank goodness for my twit fil
Randal L. Schwartz [RLS], on , , 2005 at 13:21 (-0700) has on mind:
RLS> in comment <-- -- in comment -->
could you write a snippet of code, without using any module to parse
this example ? (get comment from html)
I have similar example (it is not html file), and I'd like to know
technique for
Randal L. Schwartz [RLS], on , , 2005 at 13:21 (-0700) has on mind:
perlocean>> you mean, ?
perlocean>> @tags = $html =~ //g;
RLS> And that's still wrong.
RLS> in comment <-- -- in comment -->
RLS> All three of those phrases are officially "in comment". That's
RLS> because "--" is actually a
Vladimir D Belousov [VDB], on Friday, May 13, 2005 at 17:14 (+0400)
typed:
>>JC>
you are right. nothing be easier than edit my regexp to get:
@tags = $html =~ //g;
and this one was tested :o)
--
How do you protect mail on web? I use http://www.2pu.net
[You're not ready for immortality - Ambas
Johnstone, Colin [JC], on Friday, May 13, 2005 at 08:46 (+1000) made
these points:
JC> How can I parse HTML to find comment tags
JC> Specifically.
JC>
Hello,
is there some kind of parser for perl source ? Lets we have for
example this message as the source (input), I'd like to have all
valid perl lines in variable.
#!/usr/bin/perl -w
use strict;
my $something = 2000;
for (0 .. $something) {
print $something, "\n";
}
__DATA__
this line too
Tielman Koekemoer (TNE) [TK], on Tuesday, May 10, 2005 at 11:01
(+0200) contributed this to our collective wisdom:
TK> I have tried various regular expressions to remove null or empty
TK> values on array @array1 and create a new array @OPD01 with the values.
TK> This, however, does not work as I s
Harold Castro [HC], on Tuesday, May 10, 2005 at 00:54 (-0700 (PDT))
wrote these comments:
HC> start end Total
HC> 06:30:17 09:00:14 2.50 hours
HC> Do you know any shortcut to this instead of splitting
HC> each number in between colons?
never need this, but you should look at:
1 - 100 of 294 matches
Mail list logo