Look for tutorials on Perl/Tk
Google Perl/Tk
Here's an old one that is still good -> http://www.perl.com/pub/1999/10/perltk/
HTH
From: newbie01 perl
To: beginners
Sent: Thursday, 20 December 2012, 18:42
Subject: Tutorial for a menu driven perl script
I agree with David ... good list.
Tony
From: David Christensen
To: beginners@perl.org
Sent: Tuesday, 4 December 2012, 20:36
Subject: Re: Need a Perl Book for Beginner
On 12/04/12 14:56, Asad wrote:
> Would you guidance to start develop logic fo
rl.org
Sent: Fri, 12 August, 2011 14:13:26
Subject: Re: while(@data) works but why
On 8/12/11 Fri Aug 12, 2011 12:02 PM, "Tony Esposito"
scribbled:
> .
> .
> .
> while(@dat = $sth->fetchrow) {
> print "@dat\n";
> .
> .
> .
>
> This cod
got it ... thank you. cheers!
From: Brandon McCaig
To: Tony Esposito
Cc: beginners@perl.org
Sent: Fri, 12 August, 2011 14:08:52
Subject: Re: while(@data) works but why
On Fri, Aug 12, 2011 at 3:02 PM, Tony Esposito
wrote:
> .
> .
> .
> while
.
.
.
while(@dat = $sth->fetchrow) {
print "@dat\n";
.
.
.
This code works yet there is no 'my @dat' defined anywhere in the code.
Using Perl 5.8.x - 5.14.x
Q: Why does the variable @dat not need a 'my' in front?
Cheers!
Bravo! I am in ... but I need to traverse many links over multiple pages to
get to the one that points to the file I want to download. Would follow_link()
be the answer?
Cheers!!
From: Shawn H Corey
To: Tony Esposito
Cc: Beginners Perl
Sent: Tue, 4 May
Cheers!
New to LWP and downloading file/copying file from Web to local box. Had a go
at it and failed horribly... On Solaris 10 with Perl 5.10.
#!/usr/bin/perl -w
use strict;
use LWP::Simple qw($ua get);
my $webpage ="https://www.mywebpage.com/Documents.zip";;
$ua->timeout(20);
my $content = ge
Thx. I see that I do not need to do both! Got it fixed.
From: Uri Guttman
To: Tony Esposito
Cc: Beginners Perl
Sent: Thu, 15 April, 2010 13:04:09
Subject: Re: Date_GetPrev "error"
>>>>> "TE" == Tony Esposito writes:
Hello,
Date_GetPrev only getting 3 previous days, not 5 previous days. Using Perl
5.8.x.
Code
use strict;
use Date::Manip;
my @days = ( 'Fri', 'Mon', 'Tue', 'Wed', 'Thu' );
Date_Init("TZ=CST6CDT");
foreach (@days) {
print $_ . "\n";
}
my @dates = ();
my $today = ParseDate('today');
fore
te:
From: John W. Krahn
Subject: Re: tr// versus s///g
To: "Perl Beginners"
Date: Monday, 8 March, 2010, 9:50
Tony Esposito wrote:
> Does tr/'\n'/' '/
Replace every ' with ' and every "\n" with " " and every ' with '.
You miss my point but thanks for the syntax check. I am concerned with
comparing the functionality, one versus the other.
Thanks.
--- On Mon, 8/3/10, Shawn H Corey wrote:
From: Shawn H Corey
Subject: Re: tr// versus s///g
To: "Tony Esposito"
Cc: "Beginners Perl"
D
Does tr/'\n'/' '/ do the same as tr/'\n'/' '/g? ( replace newline with space )
If so, is one preferred over the other?
Besides this forum, does anyone know of a good Perl/Tk email list/forum in
which to ask questions about Perl/Tk?
$mytable does not
exist and just move on to the next table?
--- On Mon, 1/2/10, Tony Esposito wrote:
From: Tony Esposito
Subject: Re: prepare(SELECT ... FROM TABLE) error
To: "Beginners Perl" , "7" <7stud.7s...@gmail.com>
Date: Monday, 1 February, 2010, 17:02
Als
Also, if prepare fails, I want to continue processing -- hence the need to
capture the error in my code and not have DBI::DBD throw and exception then
stop all processing ...
--- On Mon, 1/2/10, Tony Esposito wrote:
From: Tony Esposito
Subject: Re: prepare(SELECT ... FROM TABLE) error
To
ror
To: "Beginners Perl"
Date: Monday, 1 February, 2010, 14:05
On Mon, Feb 1, 2010 at 12:11 PM, Tony Esposito
wrote:
> when the table does not exist the prepare fails. How do ignore the error
> thrown by the prepare() and catch it later in the program?
>
>
> my $dbh
when the table does not exist the prepare fails. How do ignore the error
thrown by the prepare() and catch it later in the program?
my $dbh = DBI->connect("dbi:ODBC:mysql"
,$login
,$passwd
,{ RaiseError => 0 }
Has anyone successfully used, in Oracle, a 'SELECT ... FOR UPDATE' using the
Perl DBI:: ODBC?
I need to pass an command-line arg that is a string which contains the '@'. Is
there any way to do this and also 'tell' Perl not to interpret this as other
than a '@' character?
Thx.
I need to get the current USER env var in a Windows Perl program. Does anyone
know how this is done? I have done it on UNIX/Linux.
Thx.
n to go on, though, it's hard
to diagose the original problem.
Phil
> -Original Message-
> From: Robert H [mailto:sigz...@gmail.com]
> Sent: Tuesday, December 08, 2009 6:58 PM
> To: beginners@perl.org
> Subject: Re: Email does not send attachment ...
>
> On 12/8/09 3:5
Hello,
I am using Perl 5.8 on WindowsXP and Windows Server 2003. I can not get the
following attachment to arrive/attach even though I get the email with no
issues. Any ideas?
use MIME::Lite;
use Net::SMTP;
unless (-e 'C:/my_file.log' && -s 'C:/my_file.log' ) { print "file not
found\n"
e of using row_num
instead of LIMIT (which I believe is MySQL)?
thanks
--- On Wed, 30/9/09, Steve Bertrand wrote:
From: Steve Bertrand
Subject: Re: Limit on number of columns pulled using DBI::ODBC
To: "Tony Esposito"
Cc: "Beginners Perl"
Date: Wednesday, 30 September,
: Steve Bertrand
Subject: Re: Limit on number of columns pulled using DBI::ODBC
To: "Tony Esposito"
Cc: "Beginners Perl"
Date: Wednesday, 30 September, 2009, 8:39 PM
Tony Esposito wrote:
> Is there a limit on the number of columns pulled from a table using DBI::ODBC?
Althoug
I notice the behaviour changes as I adjust the following parameter ...
$dbh->{LongReadLen} = 2;
This is an Oracle database I am going against - version 10gR2
--- On Wed, 30/9/09, Tony Esposito wrote:
From: Tony Esposito
Subject: Limit on number of columns pulled using DBI::ODBC
Is there a limit on the number of columns pulled from a table using DBI::ODBC?
Database: Oracle 10gR2
O/S: WIndowsXP
Perl: 5.8.9
I am getting an 'out of memory' error if I try to retrieve 40 columns or more
when using the following ...
my $dbh = DBI->connect( dbi:ODBC:orcl, "login", "passwo
Thank you all for the input ... I have it working now.
:-)
From: Tim Bowden
To: Perl Beginners
Sent: Wednesday, 26 August, 2009 15:20:13
Subject: Re: removing a 'tee'd file handles going forward
On Wed, 2009-08-26 at 18:22 +0000, Tony Espo
Ok. I misunderstood. Thought - incorrectly - that STDOUT and STDERR were
somehow 'joined' by the 'tee' operation. Once again, my mistake. Thx.
From: Jenda Krynicky
To: Tony Esposito
Cc: Beginners Perl
Sent: Wednesday, 26 August, 2
print' statement and then back ...
HTH
From: Jenda Krynicky
To: Beginners Perl
Sent: Wednesday, 26 August, 2009 10:44:15
Subject: Re: removing a 'tee'd file handles going forward
Date sent: Wed, 26 Aug 2009 15:36:26 + (GMT)
From: To
I want to output to both STDOUT and STDERR at one point in my program, then
want to separate the two handles going forward in the program so that output is
sent to STDOUT and STDERR separately. Given the code snip below, would the
"undef tee" do the trick?
use IO::Tee;
my $tee = new IO::Tee(
ndoze ... :-)
From: Shawn H. Corey
To: Tony Esposito
Cc: "Wagner, David --- Senior Programmer Analyst --- CFS"
; Beginners Perl
Sent: Monday, 24 August, 2009 14:49:47
Subject: Re: one liner in Windows to replace string
Tony Esposito wrote:
> I am happy that it works with double quotes BUT
x27;)" #
does not work -- compilation error ...
??
____
From: Bob McConnell
To: Tony Esposito ; Shawn H. Corey
; "Wagner, David --- Senior Programmer Analyst --- CFS"
Cc: Beginners Perl
Sent: Monday, 24 August, 2009 14:39:57
Subject: RE: one liner in Windows to replace s
txt files
...
Help again.
From: Shawn H. Corey
To: "Wagner, David --- Senior Programmer Analyst --- CFS"
Cc: Tony Esposito ; Beginners Perl
Sent: Monday, 24 August, 2009 12:57:27
Subject: Re: one liner in Windows to replace string
Wagner, David
perl -p -i.bak -e 's/CONSTANT/VARIABLE/' C:\test.txt
Trying to replace a string with this one line perl ... in Windows it does not
seem to work ...
File test.txt contents is ...
CONSTANT 100
CONSTANT 200
nothing changes ... acts as if it does not 'see' the CONSTANT string.
Help because it loo
Anyone have the code that make the 'clock' show when a Perl program is running?
What I mean by the 'clock' is the command-line movement that sequentially does
the following (in place):
- \ | / - \ | /
when running it looks like a 'clock' to show the user that something is
processing ...
Thx.
Thanks ... I'll give that a shot ... any other suggestions are welcomed ...
thank again, Dermot.
From: Dermot
To: Tony Esposito
Cc: Beginners Perl
Sent: Friday, 31 July, 2009 17:00:45
Subject: Re: Perl and HTML
2009/7/31 Tony Esposito :
> I am us
I am using Perl 5.8.x, Windows XP SP2 and Novell GroupWise email client.
I have written a program to send an email which contains HTML. Issue is that
in the email body the 'body' shows up as HTML text and GroupWise has the choice
to read it in HTML grayed-out (for this email only). In other w
Back to the question at hand - have you tried using 'tee'
use File::Tee qw(tee);
# simple usage:
tee(STDOUT, '>', 'stdout.txt');
Tony
From: John W. Krahn
To:
Sent: Tuesday, 21 July, 2009 8:41:25
Subject: Re: Having problems getting data back to STDOUT once
When trying to use split() where the delimiter is passed from the command-line
( as seen in stub code that follows ),
the code fails to parse/split input file via some characters (e.g. | ) but it
runs ok for others (e.g. , ).
Any idea what could be causing this?
Code:
use vars qw/
Hello,
Given the command line:
perl myperl.plx < myfile.txt
is there anyway from within the Perl script to capture the redirected STDIN
filename (i.e., myfile.txt)?
OS: WinXP SPSP3
Perl: 5.8.8 for Win32 from ActiveState
Thx.
but I was wondering if there was a
'1-liner' like the one previously listed).
- Forwarded Message ----
From: Tony Esposito
To: Beginners Perl
Sent: Wednesday, 13 May, 2009 12:56:45
Subject: deleting subdirectories only in Win32
Hello,
When trying to delete subdirectories and t
Hello,
When trying to delete subdirectories and their files on WinXP SP3, the
following code also removes the root directory of the subdirectories. Can I
get some assistance? I want to keep C:\my\data intact but I am losing the
\data folder
#
# Code to remove all files and subdirectories un
Just curious ... does Perl create an (intermediate) file that contains the
p-code that is created by the compiler just prior to passing control to the
Perl interpreter? If so, where would this file be and what would the file be
named? Is there a Perl command-line switch that can be used to 'ke
ERROR:
sth->fetchrow_array fails with ODBC (DBD::ODBC) connection to SQL Server but
works fine with ORACLE using DBDOracle. See error below ...
DBD::ODBC::st fetchrow_array failed: [Microsoft][ODBC SQL Server Driver]String d
ata, right truncation (SQL-01004) at create_data_dump.pl line 267, lin
I tried $foo =~ s/,/$field_term/g; and it worked fine ... thx.
From: John W. Krahn
To: Perl Beginners
Sent: Tuesday, 6 January, 2009 13:19:20
Subject: Re: trouble with 'tr' command
Tony Esposito wrote:
> Hello,
Hello,
> Trying to do the f
Hello,
Trying to do the following and the variable $field_term does not transiterate.
The $foo becomes "name$age$grade$school$semester".
#!/usr/bin/perl
my $field_term = '|';
my $foo = "name,age,grade,school,semester";
$foo =~ tr/,/$field_term/;
__END__
Please advise.
When trying to install the Spreadsheet::WriteExcel module on WindowsXP, and
using 'ppm' from ActiveState, I get thrown into a GUI that seems to be checking
what modules I already have on my system or can be installed on my system
(Spreadsheet::WriteExcel module is not one of them that is availab
If I understand you're question correctly, you can get the basename of the
script that you are running ( i.e., minus the extension ) with the code:
my ($basename) = fileparse($0, '\..*');
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N
Thank you for your input. I have found a resolution to this issue.
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
>
-Original Message-
Good points - thanks for your feedback.
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
>
-Original Message-
From: Wagner, David --- S
Thank you, Bob. Very helpful information on all fronts.
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
>
-Original Message-
Fro
in advance and cheers to our friends across the pond!
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Maybe consider:
use diagnostics;
as well, at least while you are developing your code.
Thanks! :-)
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED
lt.
$mailer->open(\%mail_headers);
print $mailer <close();
}
return(int 0);
}
#
good luck :-)
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, T
You all can ignore this thread.I walked away and came back.and
figured it out.
Thanks!
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
>
To be more precise, I need an example of sending email via UNIX sendmail
using the Mail::Mailer module.
Thanks much.
:-)
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
I need to get more info on the package Mail::Mailer, specifically how to use
the 'open' method.
Can anyone assist, please?
Thanks!
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm)
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
&
l for readability.
Anyway, thanks for all your input - this is kind of a 'religious' question
after all! :-)
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson,
{
return(int 5);
}
else {
# do nothing and there's nothing to say so just continue
}
Thanks!
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson
Thank you...I'll make a note of that.
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
>
-Origin
With the exception of the '-e' option point that you mentioned, I think what
I was trying to say ( I guess poorly ) is what you said - very eloquently, I
might add - in your summary.
Thanks for the info! :-)
> Anthony (Tony) Esposito
> Senior Technical Consultant
> I
Strike that...I missed your earlier email.sorry!
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
>
Any reason why you can not use DBI::Oracle instead of using a system call
and 'here' document to access SQL*Plus?
HTH
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Rich
ay, April 02, 2003 12:29 PM
To: Tony Esposito; [EMAIL PROTECTED]
Subject: RE: Which Perl is used to run the script???
Tony Esposito wrote:
> Question:
>
> When a Perl script - let's say myperl.pl - has the following as its
> first line:
>
> #!/usr/bin/perl
( I believe I know the answer but I have - not by my design -
several versions of Perl on my development system and I want to be sure
which Perl is being used because some have more modules installed than
others ).
Thanks!
> Anthony (Tony) Esposito
> Senior Technical Consultant
I am a strong proponent of the "top-down" approach.I feel it makes my
Perl code easier to read/follow.
I quote from "Learning Perl" that "[The subroutine] definition can go
anywhere in the program file, though
most people put it at the end".
:-)
> Anthony (
Thanks for all your input. I have used one of these methods and it worked
well.
Problem solved :-)
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
&
2_FILE => "q_x12_in.dat";
...
rename(@{[ QX12_FILE ]}, "foo.dat");
The print() works - resolves - okthe rename() does not. I assume it has
something to do with the syntax of @{[ QX12_FILE ]}.
thanks!
> Anthony (Tony) Esposito
> Senior Technical Consultant
>
Thanksgot this figured out... :-)
-Original Message-
From: R. Joseph Newton [mailto:[EMAIL PROTECTED]
Sent: Monday, March 17, 2003 11:21 PM
To: Tony Esposito
Cc: 'Brett W. McCoy'; Thomas Browner; [EMAIL PROTECTED]
Subject: Re: help with whois code
Tony Esposito wro
Good suggestion.now I just need to get Filesys.pm installed on my
system.
Thanks!
-Original Message-
From: david [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: UNIX file system free space, used space, total space
Tony Esposito
| grep " ${file_sys}\$" | awk '{print \$5}'`;
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTECTED]
I'll try itthe SiePerl instance is at home, not at work - where I am at
now!
Thanks! :-)
-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]
Sent: Monday, March 17, 2003 5:14 PM
To: Tony Esposito
Cc: Thomas Browner; [EMAIL PROTECTED]
Subject: RE: help with whois
t;use
Carp;".
:-)
-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]
Sent: Monday, March 17, 2003 4:56 PM
To: Tony Esposito
Cc: Thomas Browner; [EMAIL PROTECTED]
Subject: RE: help with whois code
On Mon, 17 Mar 2003, Tony Esposito wrote:
> I am using SiePerl.
,
the OpenPerl IDE comes up but when I run the demo Perl program it complains
about "no Carp" module.
Oh, bother!
-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]
Sent: Monday, March 17, 2003 2:54 PM
To: Tony Esposito
Cc: Thomas Browner; [EMAIL PROTECTED]
Subject
Addendum: I tried CPAN and my search(es) do not show the module itself.
Thanks!
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
BTW - Anyone know where to get the Carp module for Perl 5.6.1 on Win32 (
WindowsNT ) and how to install it? I am using the OpenPerl IDE and it
complains about not being able to locate Carp. I checked and it is not on
my Win32 system.
Thanks!
-Original Message-
From: Brett W. McCoy [mailt
See CPAN www.cpan.org for a Win32 Perl port.
-Original Message-
From: AK [mailto:[EMAIL PROTECTED]
Sent: Monday, March 17, 2003 11:04 AM
To: [EMAIL PROTECTED]
Subject: Re: Punishing Your Server With Perl
On Thu, 13 Mar 2003 14:10:36 +0800 (GMT-8), [EMAIL PROTECTED] wrote:
>> A couple of
R 4: where is between @{[
MIN_THRESHOLD ]} and @{[ MAX_THRESHOLD ]}.\n";
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMAIL PROTEC
In C, you can define a constants - "variables" whose contents can not be
changed.
Is there any way to do this in Perl? There are some variables I use that I
would love to set as a constant.
Thanks.
> Anthony (Tony) Esposito
> Senior Technical Consultant
> I
Trying it now from the Command Prompt.seems to be just 'sitting'
there.
Anthony (Tony) Esposito
Database Administrator
Inovis(tm), formerly Harbinger and Extricity
2425 North Central Expressway
Suite 900
Richardson, Texas 75080, USA
Direct (972)643-3115
Fax (972)479-9779
---
I am using ActiveState Perl 5.6.1. That does not seem too old to me. Is
there an ftp site where I can download Tk.pm?
Then I will install Tk using the Perl Package Mgr.
Thanks!
Anthony (Tony) Esposito
Database Administrator
Inovis(tm), formerly Harbinger and Extricity
2425 North Central
I did get my Perl and Tcl/Tk from ActiveState.com. So what you are saying
is I just have to download this Tk.pm file from ActiveState.com and install
it in D:\Perl\site\lib\Tk.pm and I'll be ok, correct?
Thanks!
Anthony (Tony) Esposito
Database Administrator
Inovis(tm), formerly Harbinge
And I can not find any file name Tk.pm on my system. How is this
file created? Where should it be?
Thanks!
Anthony (Tony) Esposito
Database Administrator
Inovis(tm), formerly Harbinger and Extricity
2425 North Central Expressway
Suite 900
Richardson, Texas 75080, USA
Direct (9
83 matches
Mail list logo