Hi,
Thanks for the tip about
The book Mastering Perl/Tk has a pretty good Chapter 3 on Geometry
Management.
You can probably read it for free with an sign up at
http://safari.oreilly.com/
about the piping question, it's not an either/or situation. It could be
both.
A good example is
Hi All
Can anybody suggest me any module/script that can be used to split and
image into pieces?
I tried to search in CPAN also googled a lot.
I could only find image splitting software..but I need command line
utility.
Thanks
Prasanna
Hi
I would probably use the module Imager (see CPAN), and it's crop()
function. The function doesn't modify the source, it returns a new,
cropped image based on the coordinates you submit to it.
Best regards,
Grétar Mar
Nagasamudram, Prasanna Kumar wrote:
Hi All
Can anybody suggest
-Original Message-
From: Gretar Mar Hreggvidsson [mailto:[EMAIL PROTECTED]
Sent: Monday, August 28, 2006 5:29 PM
To: Nagasamudram, Prasanna Kumar
Cc: beginners@perl.org
Subject: Re: Image split
Hi
I would probably use the module Imager (see CPAN), and it's crop()
function. The
But If I change the following line
$img-read(file='p.bmp', type='bmp') or die $img-errstr();
TO
$img-read(file='p.jpg', type='jpg') or die $img-errstr();
I get the following error.
format 'jpg' not supported at i.pl line 4.
The same is for other formatsexcept bmp.
All,
I am trying to run logic that will copy/delete 3
versions of log.\d+ files to their respective
directories. Because there are so many directories, I
have built a hash table instead of using a bunch of
if else conditions with reg exps. My problem is it
is not returning the words_num
List,
I am trying to set a variable based on a system call. Here is my code:
#!/usr/bin/perl
use strict;
my $test = system `/usr/bin/snmpget -v1 10.1.11.18 -c secret
.1.3.6.1.4.1.710.7.1.5.1.23.1.13.1|awk '{print $4}'`;
print $test\n;
When I run that command from the
Trivial problem.
What does $words *really* contain in your subrotuine words_to_num?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
try this syntax:
my $test = system (/usr/bin/snmpget -v1 10.1.11.18
-c secret
.1.3.6.1.4.1.710.7.1.5.1.23.1.13.1|awk '{print $4}');
or
my $test = qx(you command above w/no quotes needed);
or
open (SNMP, snmpget -v1 10.1.11.18 -c secret
.1.3.6.1.4.1.710.7.1.5.1.23.1.13.1 ) or die failed
They all seem to skip the awk command. For your open example, I am confused.
It gives me the error:
failed opening snmpget No such file or directory at ./test.pl line 5.
Thanks
-Original Message-
From: Derek B. Smith [mailto:[EMAIL PROTECTED]
Sent: Monday, August 28, 2006 10:05 AM
To:
Hi,
I have this web page which saves data in an xml.
The web page has few textfields which takes input
and has a submit button.The data is saved in an XML
when pressed the submit button.
I am using CGI module for web page and
Curt Shaffer wrote:
List,
Hello,
I am trying to set a variable based on a system call.
In Perl a system call would be open() or link() or crypt(), etc. You mean
that you are trying to set a variable based on the output of an external
program.
Here is my code:
#!/usr/bin/perl
use
Derek B. Smith wrote:
All,
Hello,
I am trying to run logic that will copy/delete 3
versions of log.\d+ files to their respective
directories. Because there are so many directories, I
have built a hash table instead of using a bunch of
if else conditions with reg exps. My problem is it
Curt Shaffer wrote:
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Curt Shaffer wrote:
my $test = system `/usr/bin/snmpget -v1 10.1.11.18 -c secret
.1.3.6.1.4.1.710.7.1.5.1.23.1.13.1|awk '{print $4}'`;
You are using back-quotes AND system() so if your external command displayed
the
Hi,
I don't know if this is the right mailing list for this question.
Let me know if I should go somewhere else.
The issue is a number rounding problem.
Here is my perl snippet:
$credit = 64.63;
$amount = $credit * 1000;
printf credit %s, amount %12.12d\n, $credit, $amount;
$amount =
Chris,
printf credit %s, amount %12.12d\n, $credit, $amount;
What really went wrong was to use a %d specifier. It says to truncate
a floating number into integer. Like it happens in
$ perl -e 'print int 1000*shift' 64.63
64629
If you use %f, it may improve
$ perl -e 'printf %f,
Howard, Chris schreef:
What starts out as 64.63 ends up being 0006462
No, it ends up beint printed as that. Replace your %12.12d by one of
(%s, %f, %g) to get different representations.
See also
perldoc -q decimals
--
Affijn, Ruud
Gewoon is een tijger.
--
To unsubscribe,
But the file output format I'm required to produce
is 12 positions with leading zeros and no decimal.
:-(
Chris
-Original Message-
From: Dr.Ruud [mailto:[EMAIL PROTECTED]
Sent: Monday, August 28, 2006 11:17 AM
To: beginners@perl.org
Subject: Re: number rounding problem
Howard,
Something with word size of multiplying by 1000, I'd venture.
This works as you need, I think:
$credit = 64.63;
$amount = $credit * 100;
printf credit %s, amount %12.12d\n, $credit, $amount;
$amount = $amount * 10;
printf credit %s, amount %12.12d\n, $credit, $amount;
$amount = $amount /
Howard, Chris schreef:
[next time, do not toppost, and quote more effectively]
Ruud:
Chris:
What starts out as 64.63 ends up being 0006462
No, it ends up beint printed as that. Replace your %12.12d by one of
(%s, %f, %g) to get different representations.
But the file output format
--- John W. Krahn [EMAIL PROTECTED] wrote:
Derek B. Smith wrote:
All,
Hello,
I am trying to run logic that will copy/delete 3
versions of log.\d+ files to their respective
directories. Because there are so many
directories, I
have built a hash table instead of using a bunch
On 08/28/2006 08:37 AM, Derek B. Smith wrote:
All,
I am trying to run logic that will copy/delete 3
versions of log.\d+ files to their respective
directories. Because there are so many directories, I
have built a hash table instead of using a bunch of
if else conditions with reg exps.
Thanks!
-Original Message-
From: Dr.Ruud [mailto:[EMAIL PROTECTED]
Sent: Monday, August 28, 2006 12:00 PM
To: beginners@perl.org
Subject: Re: number rounding problem
Howard, Chris schreef:
[next time, do not toppost, and quote more effectively]
Ruud:
Chris:
What starts out as
On Mon, 2006-08-28 at 12:27 +0200, John Cortland Morgan (ZG/ETK) wrote:
This will test for a pipe
#!/usr/bin/perl
# -t tests if a tty is input, else it's a pipe
if (@ARGV == 0 and -t) {
die Usage: $0 INPUT\n;
}
while () {
## process input file(s)
Derek B. Smith wrote:
--- John W. Krahn [EMAIL PROTECTED] wrote:
Derek B. Smith wrote:
I am trying to run logic that will copy/delete 3
versions of log.\d+ files to their respective
directories. Because there are so many
directories, I
have built a hash table instead of using a bunch
of
if
I'm reading in an Excel spreadsheet using Win32::OLE. I want to read in
the entire spreadsheet. I found a piece of code that does that:
$everything = $sheet-UsedRange()-{Value};
for (@$everything)
{
for (@$_)
{
print defined($_) ? $_| : undef|;
}
print \n;
}
However,
Is it possible to open excel files under linux? I read about libwin32,
and it seems it doesn't work under linux. Is this true?
Thank in advance
Toddy
This is true, however I believe Spreadsheet::ParseExcel still works
under Linux.
-Original Message-
From: Toddy Prawiraharjo [mailto:[EMAIL PROTECTED]
Sent: Monday, August 28, 2006 4:05 PM
To: beginners@perl.org
Subject: How do i open excel files under linux
Is it possible to open
$everything is a scalar reference to an array. You can dereference the
array with the '@$everything' notation or the '@{$everything}' notation.
(The second one removes any ambiguity about the reference, but 99% of
the time the first way is okay.)
You can access elements of the array by either
Use Open Office
On 8/29/06, Toddy Prawiraharjo [EMAIL PROTECTED] wrote:
Is it possible to open excel files under linux? I read about libwin32,
and it seems it doesn't work under linux. Is this true?
Thank in advance
Toddy
LOL
Thanks all, Im using Spreadsheet::ParseExcel, ::Read, and ::ReadSXC. I'm
rolling now. Found out also xls2csv is very2x helpful.
Cheers!
Toddy Prawiraharjo
-Original Message-
From: Sastry [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 29 August 2006 1:45 PM
To: [EMAIL PROTECTED]
Cc:
Hi,
I an very new to CGI and want to know how to make the
CGI(with perl) pages presently working on http work on
https.
I have the following webpage Logout.cgi.
#!/opt/plat/bin/perl
use strict;
use Time::localtime;
use CGI;
use CGI::Carp 'fatalsToBrowser';
use lib /opt/appl/web/cgi-bin;
use GS;
32 matches
Mail list logo