Re: from perl review (first article) question on regex

2008-09-29 Thread John W. Krahn
Richard Lee wrote: I was reading perl magazine and saw sub readable { my $number = shift; $matched = $number =~ s{ (\d+) (\d{3}) (,|$) }{$1,$2$3}x; } while ($matched); ^^^ You have a right brace without a corresponding left brace

Re: Hash sort order

2008-09-29 Thread Vyacheslav Karamov
Rob Dixon пишет: Vyacheslav Karamov wrote: Are you sure you shouldn't just be using HTML::TreeBuilder? Rob Yes I'm sure because: 1) I need to parse XML, not HTML 2) I have to use XML::Parser::Expat cause it is required that my program will work as fast as possible. So, I think Perl w

RE: Non standard entity conversion

2008-09-29 Thread V.Ramkumar
Hi List, I am doing entity conversion decimal entity (input xml) 2 named entity(output xml) in perl using HTML::Entities::Numbered. But it's not returning named entity for some decimal entities. If any body have idea to avoid the below issue, please share with me. Ex: Coding. use HTML::Entities:

Making tree in perl

2008-09-29 Thread Vyacheslav Karamov
Hi All! I'm parsing XML with XMPL::Parser::Expat and I need to build XML tree. Ho to make fast and robust one? I could use Tree::Simple CPAN module, but I have very restrictive performance requirements. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Display GD graph on the screen.

2008-09-29 Thread Funny Perl
I just start to learn perl on GD graph. My OS is Linux. I got a example, but how can I display the graph on the screen ? use Gtk2 or something else? Hereis is the code: #!/usr/bin/perl -w use GD; my $gd = GD::Image->new(400,300); my $white = $gd->colorAllocate(255, 255, 255); my $black = $g

Re: Non standard entity conversion

2008-09-29 Thread Vyacheslav Karamov
V.Ramkumar wrote: Hi List, I am doing entity conversion decimal entity (input xml) 2 named entity(output xml) in perl using HTML::Entities::Numbered. But it's not returning named entity for some decimal entities. If any body have idea to avoid the below issue, please share with me. Ex: Coding.

Re: Display GD graph on the screen.

2008-09-29 Thread Sandy lone
On Mon, Sep 29, 2008 at 4:05 PM, Funny Perl <[EMAIL PROTECTED]> wrote: > I just start to learn perl on GD graph. My OS is Linux. > > I got a example, but how can I display the graph on the screen ? use > Gtk2 or something else? > Generally we use GD to print the graphs to web browsers. I didn't kn

Re: Hash sort order

2008-09-29 Thread Rob Dixon
Vyacheslav Karamov wrote: > Rob Dixon пишет: >> Vyacheslav Karamov wrote: >> >> Are you sure you shouldn't just be using HTML::TreeBuilder? >> >> Rob >> >> > Yes I'm sure because: > 1) I need to parse XML, not HTML > 2) I have to use XML::Parser::Expat cause it is required that my program >

Re: negate a string

2008-09-29 Thread Paul Lalli
On Sep 28, 3:18 pm, [EMAIL PROTECTED] (Loke) wrote: > Hi. I am trying to filter strings which do not have :// in them, I am > able to find strings with :// but I want to do the exact opposite. > > regex to match :  /(.*:\/\/.*)/i > > I tried /(.*(?!:\/\/).*)/i but it does not work. if ($string !~

Re: Display GD graph on the screen.

2008-09-29 Thread Mr. Shawn H. Corey
On Mon, 2008-09-29 at 01:05 -0700, Funny Perl wrote: > I just start to learn perl on GD graph. My OS is Linux. > > I got a example, but how can I display the graph on the screen ? use > Gtk2 or something else? The quickest way is to use system and the open command for your desktop. For GNOME, the

Re: Display GD graph on the screen.

2008-09-29 Thread Mr. Shawn H. Corey
On Mon, 2008-09-29 at 23:05 +0800, Sandy lone wrote: > Generally we use GD to print the graphs to web browsers. > I didn't know if it can print to a TK application, but we use it > widely on CGI programming. Tk can display images using a canvas widget. If you use Gtk, consider using Glade for you

reference question

2008-09-29 Thread Richard Lee
one more question on reference, if say you have sub as below my @arrayref; sub do_something { my $something = @_; open FILE, "$something", or die; while () { my @array = map (split /,/)[1,2,3,5]; push @arrayref, [EMAIL PROTECTED]; } clos

Re: reference question

2008-09-29 Thread Rob Dixon
Richard Lee wrote: > > one more question on reference, > > if say you have sub as below Your code is badly wrong. Please let me correct it first. > my @arrayref; > > sub do_something { > my $something = @_; That will set $something to the number of parameters passed in @_ To retrieve

Re: reference question

2008-09-29 Thread Chris Charley
From: "Richard Lee" one more question on reference, if say you have sub as below my @arrayref; sub do_something { my $something = @_; open FILE, "$something", or die; while () { my @array = map (split /,/)[1,2,3,5]; push @arrayref, [EMAIL PROTECTED

Re: reference question

2008-09-29 Thread Chris Charley
From: ""Chris Charley"" From: "Richard Lee" one more question on reference, if say you have sub as below my @arrayref; sub do_something { my $something = @_; open FILE, "$something", or die; while () { my @array = map (split /,/)[1,2,3,5]; push @a

GUI form for text-based search

2008-09-29 Thread bdy
Hello. I have multiple directories with numerous files in each (all readable by a Perl-based search command, such as file::grep). What module, if one exists, could I use or tweak if I wanted to create an HTML form to search those files in the aforementioned directories with human readable output?

How can I execute linux commands on terminal and catch the results?

2008-09-29 Thread Daniel Nascimento
Hello everyone! I'm learning perl and I need some help. I want to write a script that execute commands into a linux terminal and catch the results but I don't know how to do this. Example: I want a script try to create a new user, but it has to verify if the user is created before do it. If the u

Re: Display GD graph on the screen.

2008-09-29 Thread Funny Perl
On Sep 29, 11:05 pm, [EMAIL PROTECTED] (Sandy lone) wrote: > On Mon, Sep 29, 2008 at 4:05 PM, Funny Perl <[EMAIL PROTECTED]> wrote: > > I just start to learn perl on GD graph. My OS is Linux. > > > I got a example, but how can I display the graph on the screen ? use > > Gtk2 or something else? > >

Re: How can I execute linux commands on terminal and catch the results?

2008-09-29 Thread Andrew Smith
Hi Daniel I think the qx command will do what you want. It's described in perldoc perlop An example of it in use is perl -e '$res=qx/date/;print $res;' -- Andrew Daniel Nascimento wrote: Hello everyone! I'm learning perl and I need some help. I want to write a script that execute commands into

Re: reference question

2008-09-29 Thread Richard Lee
Rob Dixon wrote: Richard Lee wrote: one more question on reference, if say you have sub as below Your code is badly wrong. Please let me correct it first. my @arrayref; sub do_something { my $something = @_; That will set $something to the number of parameters pas

if condition question

2008-09-29 Thread sanket vaidya
Hi all, Kindly go through the below codes: use warnings; use strict; my $string = "test"; if ($string eq "test") { print "correct"; } Output: Correct Now when I write the same if condition in program as below, I get warning along with output. use warnings; use strict; m

Re: if condition question

2008-09-29 Thread John W. Krahn
sanket vaidya wrote: Hi all, Hello, Kindly go through the below codes: use warnings; use strict; my $string = "test"; if ($string eq "test") { print "correct"; } Output: Correct Now when I write the same if condition in program as below, I get warning along with output. use warnings; use

Fwd: Modifying a specific node

2008-09-29 Thread Ganesh Babu N
My XML file is like below: ... ... Harv L R My INI file info is like below: Harv L RHarvard Law Review MLRModern Law Review The required output is as follow: ... ... Harvard Law Review The is present in other locations also. We have to modify only titles which are c