a newbie encounters difficulties in using module


I'm testing the codes obtained from internet: use Imager; use Imager::Plot; $plot = Imager::Plot->new(Width => 550, Height => 350, GlobalFont => 'ImUgly.ttf'); my @X = 0..100; my @Y = map { sin($_/10) } @X; my @Z = map { 1+cos($_/10) ...
Posted On: Sunday 11th of November 2012 11:57:09 PM Total Views:  138
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




A good Perl book for newbies/beginners using Windows?

! I am looking for a good hardcopy Perl book for newbies/beginners (including myself) who use Windows (not UNIX/Linux) and that isn't so old. After talking to my Linux friends who use Perl, they suggested these two: 1. http://oreilly.com/catalog/9781565923249/ (1997 though and mentions Windows NT) 2. http://www.amazon.com/Programming-Pe...ref=pd_sim_b_1 (has UNIX references; from 2000). However, my boss said "They seem a bit out of date. Perl has evolved from 1997 and 2000. We may need something more current." Any suggestions on recent revisions for Perl newbies who use Windows (XP-Vista) Thank you in advance. -- "An ant can do more than an ox that is lying down." --unknown /\___/\ / /\ /\ \ Ant @ http://antfarm.home.dhs.org (Personal Web Site) | |o o| | Ant's Quality Foraged Links (AQFL): http://aqfl.net \ _ / Please remove ANT if replying by e-mail. ( )
VIEWS ON THIS POST

143

Posted on:

Tuesday 16th October 2012
View Replies!

Dumb newbie question: multiple dialogs

Background: I'm a very experienced Perl programmer and have dealt with real time/event driven programs for decades, so little of that aspect of Tk is a problem for me. What I'm having trouble getting my head around is how to do a "multiple screen" application. When it starts, it'll have a window with some buttons and menus on it, but when you select one of the actions, that dialog box should go away and by one appropriate to the action you've selected. I'm fiddling with Tk-izing a program that current uses CGI [*solely* so I could do forms so I could get buttons and drop-down lists, and text input boxes, etc )]. CGI made it easy when you clicked on something I could make the resulting screen look like whatever was appropriate for the action [e.g., one set of actions was a fairly complicated database-update function [involving making coordinated changes in a bunch of joined tables]. So on the first, main, screen there was an button in a form and when you clicked it, you got a screen with info about what you were changing, input-text boxes for various new values, some checkboxes for optional things... then you clicked "update", got a new screen with nothing but some confirmation text on it and an "OK" button, then you went back to the main screen. Here's my best guess for how to organize this with Tk and I'd appreciate some advice if this is moving in the right direction and whether I'm thinking about it properly: For each of the various "areas" of the program, I'll create a TopLevel object (probably in the program's before MainLoop initialization), pack it with whatever is appropriate for that part of the program, and then "withdraw" it (dunno: maybe I can create it withdrawn \t). When the user clicks on, say, the "go do THAT function" button in the main window, I'll "withdraw" the main window and then "raise" the TopLevel for the function, and then vice versa, re-raising the Main Window when the user completes the action and it is time to go back and, in essence, ask "what's next". That reasonable\t
VIEWS ON THIS POST

88

Posted on:

Wednesday 17th October 2012
View Replies!

[newbie]How to call stored procedure using DBIx?

all! I've stored procedures defined in my database schema, and I need to call them in my code. The arbitrary-sql approach won't help since it writes sql statements in source code to act as stored procedures. So could I do that in DBIx Thank you! , On Fri, 28 Dec 2007 22:58:25 +0800, Tony Winslow wrote: > The env: Catalyst, DBIx::Class, MySQL > If I can get a $dbh from what I already have from DBIx::Class, the > problem can be solved. Yet I can figure out a way to get it. See DBIx::Class::Storage:BI: $schema->storage->dbh -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/
VIEWS ON THIS POST

78

Posted on:

Saturday 20th October 2012
View Replies!

perl newbie question...................

Whats wrong with code excerpt below I put file test operators in an array list (arg) and 2 filenames in a 2nd array list (fname). I do a test if ( ("$arg $filename") ne 0) { print "yes\n" } else { print "yes\n" } ---------------------------------------------- #!/bin/perl -w @arg=('-e', '-d', '-r', '-w', '-x', '-S'); @is=("exists ", "directory ", "readable ", "writeable ", "executable ", "socket "); @fname=($0, "perl.exe"); foreach $filename(@fname) { $ndx=0; foreach $argument(@arg) { print "is $filename a ", $is[$ndx++]; if ( ("$argument $filename" ) ne 0) { print "yes\n"; } else { print "no\n"; } } }
VIEWS ON THIS POST

197

Posted on:

Saturday 20th October 2012
View Replies!

Use of "return" in place of "last" (newbie question)?

I am new to perl, and I am wondering whether it is a bad thing to jump out of a foreach loop with return. I have a function which searches for a value in one of several arrays. If the value is found in any of them, then the whole function may as well terminate. At the moment I am setting a flag when the value is found, which stops execution of the later loops. Would it be safe / stylistically sound to do away with the flag by using "return" rather than "last". Example code follows. TIA sub example{ my $found; $found = 0; foreach $item (@list) { if ($value eq $item) { print ("found $value\n"); $found = 1; last; } } .... several other foreach loops follow in which the only thing which differs is the name of the array which is "@list" above, and the test for the flag. return }
VIEWS ON THIS POST

65

Posted on:

Monday 5th November 2012
View Replies!

perl newbie File manipulation

This is how I would do that:CODE$file = $ARGV[0];open(INPUTFILE,$file)||die"couldn't open the file!";while(){\tlast if/Processing table/;}while(){\tlast if/99: VolumeTable/;#\t\t\t\t\tmanipulate the data } Francohttp://www.xcalcs.com : Online engineering calculationshttp://www.megamag.it : Magnetic brakes for fun rideshttp://www.levitans.com : Air bearing pads
VIEWS ON THIS POST

200

Posted on:

Wednesday 7th November 2012
View Replies!

logic help for newbie

Need a little point in right direction.. I have a list of filenames stored in a txt filethat I want to copy from 1 machine to another and check that they copied based on doing keeping track by file id and then a comparison of the filesize to make sure they match afte the copy.\tCould someone just give me a general idea on this\ti'm not sure where to even begin as far as a best method.I figured I'd open the file list then stick them in an array ( or would a hash be more ideal )this is where a lot of my confusion begins with when is the best tiem to use arrays or hash to parsethe files are in the flat file by a file id, size, filename. F1 size file1F2\tsize file
VIEWS ON THIS POST

88

Posted on:

Wednesday 7th November 2012
View Replies!

newbie question - handling email addresses

I'm 100% new to Perl but I've been given a project with it anyway, so I have some pretty basic questions. The script is used to process a form submitted in PHP. I have it working fine, but I need to add an email address field now. i was told that Perl doesn't like the "@" character (which makes sense), and I know that I could use the backslash, but does Perl treat the submitted field as an object, or will I have to add some functionality which adds the backslashes before the form is submitted to the Perl Basically, do I need to even worry about the @ symbol if I'm working with the submitted form fields in Perl, or will the @ still crash the script
VIEWS ON THIS POST

206

Posted on:

Wednesday 7th November 2012
View Replies!

Dividing a problem into subproblems and using mulitiple CPU's andperl in linux

Dear Sir/Madame, I have a couple of questions regarding multi-tasking using perl in a unix multi-CPU environment. I have a unix system with 4 CPU's. If i can divide the solution of a problem into 4 independent subproblems, would there ...
VIEWS ON THIS POST

149

Posted on:

Saturday 10th 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

152

Posted on:

Saturday 10th November 2012
View Replies!

Perl Module using XS

"XS ": I am trying to develop a perl extension using XS that would execute a DB2's '.sqc' generated c executable.( equivalent of Oracle's pro*c generated executable). The 'C' executable executes fine by itself. I am having a hard ...
VIEWS ON THIS POST

64

Posted on:

Saturday 10th November 2012
View Replies!

Anyone using IPC::Cmd on Windows?

I'm using ActiveState Perl 5.10.0 for Windows, and wanted to use IPC::Cmd for running external programs. To my surprise, I found IPC::Cmd->can_capture_buffer returning false, meaning that I can't use it to capture the output of the programs. Also, I found ...
VIEWS ON THIS POST

81

Posted on:

Saturday 10th November 2012
View Replies!

Executing a unix command using file-handle

Dear List I am facing the following problem.While running the below mentioned code open(WHO, "who|")or die "can't open who: $!"; @arr = ; close(WHO); print $arr[2]."\n"; I am getting this output --- root tty3 2008-02-24 12:58 . But when i ...
VIEWS ON THIS POST

60

Posted on:

Saturday 10th November 2012
View Replies!

Re: Error while using BCP in from Inside Perl Script

On Jan 10, 2008 2:09 AM, wrote: > I am trying to bcp in data into a table from inside a perl script. > Though the data gets inserted into the table but still I am getting > following ...
VIEWS ON THIS POST

45

Posted on:

Saturday 10th November 2012
View Replies!

trying to read mail using net::pop3...sees message, but fails to read

hello!here's my code:CODE$pop = Net::POP3->new( "pop.myserver.com" ) or die "Can't connect to pop.myserver.com: $!\n";$username='myaccount@email.com';$password='test2pass';defined ($pop->login($username, $password));defined ($pop->login());%undeleted = $pop->list();foreach $msgnum (keys %undeleted) {print "Message $msgnum is $undeleted{$msgnum} bytes long.\n";print "Retrieving $msgnum : ";$message = $pop->get($msgnum);if ($message) {print "\n";print @$message;}else {print "failed ($!)\n";}}seems to find the message in there, but doesn't do anything more. here's the output:Message is bytes long. Retrieving : failed () Seems to me that it finds the 1 email in the box or it wouldn't get to the "message is bytes" section, righti'm trying to pull all the info, from, subject, message, date and organize neatly...of course
VIEWS ON THIS POST

107

Posted on:

Saturday 10th November 2012
View Replies!

Running a script under a different user using 'become'

I have a txt file containing a list of filenames (with full path) that need to be deleted from a server. Currently, i have to manually run a delete script as user 'xyz' using the become command on linux:roc01[phase1]:/u02/Code> become xyzdug's Password:***manually enter my password, then run the script.Is it possible to automate this I can't seem to find anything on the web about 'become', and i don't have 'su' or 'sudo' access
VIEWS ON THIS POST

65

Posted on:

Saturday 10th November 2012
View Replies!

lines to a hash: skipping doubles using loop control

No, it is faster than a regexp, but of course this might be of little importance in your situation. Francohttp://www.xcalcs.com : Online engineering calculationshttp://www.megamag.it : Magnetic brakes for fun rideshttp://www.levitans.com : Air bearing pads
VIEWS ON THIS POST

71

Posted on:

Saturday 10th November 2012
View Replies!

avoid using a temporary variable

How can I get rid of the @foo This does what I want, but uses the "temporary" variable @foo: $ ls | perl -e '@foo=<>; chomp @foo ; print join(" ", @foo)' This eliminates the temporary variable but doesn't work: ...
VIEWS ON THIS POST

60

Posted on:

Sunday 11th November 2012
View Replies!

Good intro to perl to a "newbie to programming"

I am looking for a book on Perl that introduces it to a person who is not a programmer, and offers a track along with exercises, etc. That would be for someone who does not know any programming, so it ...
VIEWS ON THIS POST

80

Posted on:

Sunday 11th November 2012
View Replies!

CSV to ~XML (total newbie)

, Never written a line of Perl until now but I think it might be perfect for this little program I need. I have some CSV files that are given to me and I need to spit them in ...
VIEWS ON THIS POST

84

Posted on:

Sunday 11th November 2012
View Replies!