Re: Determine upload file type

2008-06-20 Thread Beginner
On 20 Jun 2008 at 11:43, Mimi Cafe wrote: I need to write a cgi program to enable our users to upload files using the web browser, but I am not sure how to figure out the type of file the user wants to upload (e.g text or binary file). Can CGI.pm accomplish this automatically? Any

Re: Could not open testfile.txt: No such file or directory

2008-05-30 Thread Beginner
Hi, Did you mean to mail the cgi list? On 30 May 2008 at 13:04, Mimi Cafe wrote: use constant DEFAULT_REPORTDIR = .\\compare_report; Is this a windows path? You can and probably should always use '/' for directory path separators or in this case 'compare_report' would do. my $master_list

Re: Suggestions for a simple configuration management web application

2008-03-12 Thread Beginner
On 11 Mar 2008 at 11:54, Richard wrote: Hey all, I am trying to find a simple, modular web based configuration application and am having a little trouble. Basically, I need something to do some simple configurations on an appliance similar to something like a laser printer. You know the

Send a file

2008-02-19 Thread Beginner
Hi, I am trying to send a file in response to a request but am having trouble. Here's what I have so far. I am not certain what the headers should be. I am not getting any more info from my error_log except Premature end of script headers. my $s = (stat($file))[7]; my $filename =

Re: What is the function value in perl?

2008-01-12 Thread Beginner
I know how to read the key from the keyboard now but when I use the Readkey to read the F3 key, it only show 0 for the key, and it is same as other Fx key... Is that any other way to find other those Fx key ASCII value in perl? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: What is the function value in perl?

2008-01-07 Thread Beginner
On 1月5日, 下午6時19分, [EMAIL PROTECTED] (Peter Scott) wrote: On Fri, 04 Jan 2008 09:04:48 -0800, Beginner wrote: Hi all, Can any body teach me how to input the function key in perl? such as Esc, F1, F2, F3, F4... I' m programming something with perl to work with IBM AS400 system

What is the function value in perl?

2008-01-04 Thread Beginner
Hi all, Can any body teach me how to input the function key in perl? such as Esc, F1, F2, F3, F4... I' m programming something with perl to work with IBM AS400 system, and it needs to input some key like F3, F9.. Thanks!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Extract attribute from huge xml file

2007-12-10 Thread Beginner
Hi, I have a huge XML file, 1.7GB, 53080215 lines. I am trying to extract an attribute from each record (code=). I several problems one of which is the size of the file is making it painful to test my scripts and methods for parsing. I would like to extract a few hundred records (by any

Re: modify mirror list - CPAN

2007-12-03 Thread Beginner
On 24 Oct 2007 at 7:22, Tom Phoenix wrote: On 10/24/07, Beginner [EMAIL PROTECTED] wrote: I want to modify the mirror list that I selected when I did a first run of perl -MCPAN. You can modify your settings within a CPAN shell session by using the o command. But it may be easier

Re: seek and tell

2007-11-30 Thread Beginner
On 30 Nov 2007 at 10:35, John W.Krahn wrote: On Friday 30 November 2007 09:07, Beginner wrote: Hello, [ SNIP ] $| = 1; You never print to STDOUT so that line is superfluous. my $in = 0; my $sRootPath = 'e:/'; my ($osVolName,$lVolName,$ouSerialNum,$ouMaxNameLen,$osFsType

seek and tell

2007-11-30 Thread Beginner
Hi, Can someone spot and explain what I am doing wrong. I have a script that should read the contents of a CD (on Win32). I want a summary at the top of the page of what I've found. I use find to count the files and dirs and I want the total files ($in) to be a the top before I list the

Re: How can I assign system() call to a Variable

2007-11-14 Thread Beginner
On 13 Nov 2007 at 19:11, Marco wrote: Hi... Hi Can someone help me on this? Actually I can get the dara from the system()...But it shows 0 when I print the $result...How can I assign the system() to $result ?Thanks... here below is the code... $inact = cat /proc/meminfo | grep -w

Re: Hash slice

2007-11-12 Thread Beginner
On 9 Nov 2007 at 20:04, Jenda Krynicky wrote: From: Beginner [EMAIL PROTECTED] On 9 Nov 2007 at 16:35, Jenda Krynicky wrote: From: Beginner [EMAIL PROTECTED] #!/bin/perl use strict; use warnings; use Data::Dumper; my @keys = qw(fe fi fo thumb); my

Hash slice

2007-11-09 Thread Beginner
Hi all, Is it possible to make a hash slice like so my %hash; @[EMAIL PROTECTED] = [EMAIL PROTECTED]; My efforts suggest not: #!/bin/perl use strict; use warnings; use Data::Dumper; my @keys = qw(fe fi fo thumb); my @vals = 1..4; my %hash; @[EMAIL PROTECTED] = [EMAIL PROTECTED]; print

Re: Hash slice

2007-11-09 Thread Beginner
On 9 Nov 2007 at 14:59, Rob Dixon wrote: Beginner wrote: Hi all, Is it possible to make a hash slice like so Hey Dermot Hi Rob, It's certainly possible, but I'm not sure why you've taken a reference to your key and value arrays. [EMAIL PROTECTED] is a single scalar value

Re: Hash slice

2007-11-09 Thread Beginner
On 9 Nov 2007 at 16:35, Jenda Krynicky wrote: From: Beginner [EMAIL PROTECTED] #!/bin/perl use strict; use warnings; use Data::Dumper; my @keys = qw(fe fi fo thumb); my @valone = 1..4; my @valtwo = 10..14; my %hash; @[EMAIL PROTECTED] = [EMAIL PROTECTED],@valtwo

Re: DBI prepare syntax

2007-11-08 Thread Beginner
On 8 Nov 2007 at 8:59, Mike wrote: Hi, #Update override_exclude set th_flag=N to indicate that thesaurus entries #have been added to sierra2_thesaurus.xml use DBI; my $dbh = DBI-connect(dbi:mysql:endeca_tracking,$user,$password); my $sth = $dbh-prepare('update

Re: FileHandle

2007-11-01 Thread Beginner
On 1 Nov 2007 at 19:20, Kaushal Shriyan wrote: Hi I am using FileHandle, Below is my code #!/usr/bin/perl use warnings; use strict; open(LOGFILE, messages) || warn Could not open messages; open(DATA, /tmp/data) || die Could not

Re: FileHandle

2007-11-01 Thread Beginner
On 1 Nov 2007 at 19:43, Kaushal Shriyan wrote: Thanks Rob Its working Fine, Now when I am using the below code to write something to file messages the below code is not writing the text write some text to the file messages. ##

impatient DBI query

2007-10-31 Thread Beginner
Hi, I have ordered my Perl DBI book (is that a leopard?) but I am impatient and want to know how I could do a select/like statement a bit like this: SELECT foo FROM bar WHERE foo like 'baz%' the % being the wildcard operator. Any advice? Dp. -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: impatient DBI query

2007-10-31 Thread Beginner
On 31 Oct 2007 at 0:00, Jeff Pang wrote: -Original Message- From: Beginner [EMAIL PROTECTED] Sent: Oct 31, 2007 9:20 PM To: beginners@perl.org, beginners@perl.org Subject: impatient DBI query Hi, ...snip try something like this: my $dbh = DBI-connect(...); my

Quotes and apostrophes assistance

2007-10-29 Thread Beginner
Hi, I am trying to insert a lots file paths into an SQLite table and am having trouble with filenames with apostrophes in. Below is the snippet I have been using. I have experimented with sprintf, qq and a combination of both but can't get a quoting system that will get DBI to accept paths

Re: array within array

2007-10-29 Thread Beginner
On 29 Oct 2007 at 8:42, Mike Tran wrote: Hey all, I'm new with Perl and need help with this simple script. I'm still playing around with the script below to get a feel for Perl. My script below is incomplete and I'm doing an array within an array which is incorrect. Please help.

Re: Quotes and apostrophes assistance

2007-10-29 Thread Beginner
On 29 Oct 2007 at 10:55, Paul Lalli wrote: On Oct 29, 12:31 pm, [EMAIL PROTECTED] (Dr.Ruud) wrote: Beginner schreef: I am trying to insert a lots file paths into an SQLite table and am having trouble with filenames with apostrophes in. Use placeholders, Good advice. so

Re: error in qx

2007-10-26 Thread Beginner
On 26 Oct 2007 at 19:14, Jeff Pang wrote: On 10/26/07, Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote: Hi All, I am executing my $usr=qx(who am i); to get the user id on unix machine but it is giving error. sh: who am i: not found Oops,it's `whoami` not `who am i` unless you have

modify mirror list - CPAN

2007-10-24 Thread Beginner
Hi, I want to modify the mirror list that I selected when I did a first run of perl -MCPAN. One of the mirror I choose has stopped being a mirror and causing the the install process to take much longer. I did perl -MCPAN -e shell but there were no options that looked relevant. Is there a way

Help generating XML output

2007-10-23 Thread Beginner
Hi, I have been trying to output XML that looks like this: users username id=10dermot/username username id=17joe/username ... /users I have tried XML::Simple and XML::Generator but keep hitting the same problem when it comes to separating the id attribute and the value from my

Re: Help generating XML output

2007-10-23 Thread Beginner
On 23 Oct 2007 at 12:12, Rob Coops wrote: foreach my $k (keys %{$ref}) { $xml = $gen-users( # $xml gets over written with every new key So instead of doing that I would try $xml .= (appending) $gen-username({ id = $ref-{$k}},$k),

Re: Help generating XML output

2007-10-23 Thread Beginner
On 23 Oct 2007 at 14:21, Jenda Krynicky wrote: From: Rob Dixon [EMAIL PROTECTED] I am unfamiliar with XML::Generator, but have experimented with it for the purposes of your question and it seems to be essentially a translator that will convert a Perl fragment into an XML fragment, and I

Re: Help generating XML output

2007-10-23 Thread Beginner
On 23 Oct 2007 at 16:46, Jenda Krynicky wrote: From: Beginner [EMAIL PROTECTED] On a more general point I haven't found it easy to find modules that output XML or perhaps I should say, I didn't find the ones I did look at to be well documented in terms of examples or show the variety

Re: code ref within a hash?

2007-10-19 Thread Beginner
On 19 Oct 2007 at 15:29, Beginner wrote: On 19 Oct 2007 at 9:26, Stephen Kratzer wrote: On Friday 19 October 2007 07:41:40 Beginner wrote: ...snip so I modify the hash so it looks like: ...snip 'name' = edit_from_path($File::Find::name), I guess I should write

code ref within a hash?

2007-10-19 Thread Beginner
Hi, In the script below I am trying my hand at using a code ref within a hash. I want the key 'name' to contain a scalar value. It does but I am not sure how to dereference it. Here is the output from the script at the moment. /data/users/nat/finished/01.tif SCALAR(0x8db3cac)

Re: Storing a subroutine pointer inside a variable?

2007-10-09 Thread Beginner
On 9 Oct 2007 at 9:01, Jeff Pang wrote: 2007/10/9, yitzle [EMAIL PROTECTED]: sub test { my ($function, $description, $var, undef) = @_; print $description . : ; print $function-($var) ? Yes\n : No\n; } Can someone explain why there is a 4th, undefined variable being declared in test?

Re: Hash receive Array

2007-10-09 Thread Beginner
On 9 Oct 2007 at 11:09, Rodrigo Tavares wrote: Hi Hello, I created a hash with some elements and keys. The hash must receive a array. Can I do it ? yes. I think this will work. $hash{'myarray'} = [1, 2, 3]; or $hash{'myarray'} = [EMAIL PROTECTED]; and I am sure there are lots

Variable scope

2007-10-02 Thread Beginner
Hi, I thought that the code snip below should work but I am not getting my text into the the file. The file is created but it's empty. Ideally I want to create the log file outside any sub routines so that $log to be available to any sub I have created and hence not scoped to any one sub

Re: Variable scope

2007-10-02 Thread Beginner
On 2 Oct 2007 at 15:23, Rob Dixon wrote: Hi Dermot. You're a little confused, but you're not far out! Your being kind. $| = 1; I wasn't aware this only applied to STDOUT. My log messages all appear at once, when the script has exited and I was hoping for some 'realtime' messages.

Re: Text::Aspell

2007-09-14 Thread Beginner
On 11 Sep 2007 at 12:38, Chas Owens wrote: On 9/11/07, Beginner [EMAIL PROTECTED] wrote: snip I think my installation might be broken some how. Would you agree? snip At this point, yes, there is something other than the Perl code you/I wrote that is at fault. My versions are Aspell

Re: Help with data returned by regex match

2007-09-11 Thread Beginner
On 11 Sep 2007 at 11:36, kapil.V wrote: Hi, #!/usr/bin/perl -w my $path = shift; my $machine = shift; my (undef,$country, $property) = split /\//,$path; my $xmlData = qx!./pindown. php $machine!; my @contacts = $xmlData =~ /property name=\$property\ country=\$country\ .+?contact

Re: Text::Aspell

2007-09-11 Thread Beginner
On 11 Sep 2007 at 9:25, Chas Owens wrote: On 9/11/07, Dermot Paikkos [EMAIL PROTECTED] wrote: On 10 Sep 2007 at 12:52, Chas Owens wrote: ..snip Three things: 1. You are building dict.local, but the error message says local.dict 2. Did you try my example and did it work? 3. You aren't

Re: Text::Aspell

2007-09-11 Thread Beginner
On 11 Sep 2007 at 10:04, Chas Owens wrote: On 9/11/07, Beginner [EMAIL PROTECTED] wrote: snip Please do not type error messages. Copy and paste them instead. Actually the rule should be, don't type anything but your commentary. snip mkdir temp cd temp echo Aberystwyth words echo

Text::Aspell

2007-09-10 Thread Beginner
Hi, I am sorry if this is a bit module specific, I am hoping someone on the list has some experience of Text::Aspell and can help. I am trying to use a custom dictionary. I can use the command line aspell check --master=./dict.local somefile and words included in my dictionary like

Re: Test data generation using Perl Scripting.

2007-09-07 Thread Beginner
On 7 Sep 2007 at 9:47, Chas Owens wrote: On 9/7/07, Chas Owens [EMAIL PROTECTED] wrote: snip #FIXME: this creates invalid dates like 2007-02-30 sub rand_date { sprintf %04d-%02d-%02d, 2000 + int rand 7, 1 + int rand 12, 1 + int

Re: Regex help

2007-09-04 Thread Beginner
On 3 Sep 2007 at 17:44, Rob Dixon wrote: Beginner wrote: I am trying to come up with a regex to squash multiple commas into one. The line I am working on looks like this: SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, , DANGER,DANGEROUS,PHYSICAL, , CONCEPT,CONCEPTS

Re: how to remove ^M character from every line

2007-09-03 Thread Beginner
On 3 Sep 2007 at 17:26, divya wrote: A file generated on Windows machine is used on linux m/c while scripting. A sample line from the file is as shown: //---^M File name : project_name^M . Now in the perl script how can I remove

RE: how to remove ^M character from every line

2007-09-03 Thread Beginner
On 3 Sep 2007 at 13:38, Andrew Curry wrote: The problem is its unclear, its always better to be clear in code. It will also remove any formatting from the end of lines. If you wanted to be just as crude you can use chomp. I paritally agree that it could be un-clear. Perhaps s/\s+$//;

Regex help

2007-09-03 Thread Beginner
Hi, I am trying to come up with a regex to squash multiple commas into one. The line I am working on looks like this: SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, , DANGER,DANGEROUS,PHYSICAL, , CONCEPT,CONCEPTS, , , , , , , , , , There are instances of /,\s{1,},/ and /,,/ The bit

RE: Regex help

2007-09-03 Thread Beginner
On 3 Sep 2007 at 16:15, Andrew Curry wrote: Think s/(\,+\s*)+/,/g; Should work It produces SPEED OF LIGHT,LIGHT SPEED,TRAVEL,TRAVELLING,DANGER,DANGEROUS,PHYSICAL,CONCEPT,CONCEPTS If that's what you want. Exactly what I want. Thanx, Dp. -- To unsubscribe, e-mail: [EMAIL

RE: Regex help

2007-09-03 Thread Beginner
On 3 Sep 2007 at 16:12, Andrew Curry wrote: $ perl -le' $_ = q[SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, , DANGER,DANGEROUS,PHYSICAL, , CONCEPT,CONCEPTS, , , , , , , , , , ]; print; s/,\s*(?=,)//g; print; ' SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, ,

Logging STDERR and other output

2007-08-30 Thread Beginner
Hi, I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, /usr/local/myreports/report.log) || die Can't write to file: $!\n; } use strict; use warnings; ... ### Start some logging ### my $log; my

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 6:32, Peter Scott wrote: On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, /usr/local/myreports/report.log

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 10:59, Adriano Ferreira wrote: On 8/30/07, Beginner wrote: BEGIN { unshift @INC, '/etc/perl'; This is better done with use lib qw(/etc/perl); use lib ('/etc/perl'); Well that seems to work :-). which doesn't need the surrounding BEGIN block

Re: marine subroutine

2007-08-30 Thread Beginner
On 30 Aug 2007 at 1:18, anders wrote: On 30 Aug, 09:39, [EMAIL PROTECTED] (Amichai Teumim) wrote: Hi I'm trying to understand subroutines. #!/usr/bin/perl marine() sub marine { $n += 1; #Global variable $n print Hello, sailor number $n!\n; } This doesn't work.

Re: marine subroutine

2007-08-30 Thread Beginner
On 30 Aug 2007 at 17:29, Martin Barth wrote: On Thu, 30 Aug 2007 15:39:14 +0100 Andrew Curry [EMAIL PROTECTED] wrote: That's rubbish, but you get a warning like: main::a() called too early to check prototype at -e line 1. Use Prototypes at the beginning of your file if you want to

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 10:07, Mumia W. wrote: On 08/30/2007 09:37 AM, Beginner wrote: [...] I tried the INIT option and that worked also and I liked the fact that my `perl -c myscript.pl` sent it's output to screen and not my log file and I can use a scalar for logfile. q1) Does

Mirror service closure

2007-08-07 Thread Beginner
The Joint Information Systems Committee (JISC) run for academic institutions has closed the mirror service in the UK as of the 31st July. What a shame. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Mirror service closure

2007-08-07 Thread Beginner
On 7 Aug 2007 at 5:44, Jeff Pang wrote: The Joint Information Systems Committee (JISC) run for academic institutions has closed the mirror service in the UK as of the 31st July. What mirror?CPAN or perl.com? CPAN was one of them but they mirrored lots of O/S material, Fedora,

Re: problem with Sterling pound sign

2007-08-06 Thread Beginner
On 6 Aug 2007 at 12:50, Rob Dixon wrote: Dermot Paikkos wrote: CGI; Mime::Lite; I am trying to take the input from a text field from a html page and send it as an email. The text contains a UK sterling £ sign. It looks fine on in the html page but when I send the mail or output the

Re: Perl directory listing program

2007-06-12 Thread Beginner
On 12 Jun 2007 at 16:26, [EMAIL PROTECTED] wrote: Looking for some help here you perl geniuses you : ) I need a program that will list all of the files in a directory. Without any arguments the program will list only the files (not directories) in the current directory. But I must have

Re: Using SOAP::Lite

2007-06-11 Thread Beginner
Going to top post because I am not referring to your code Mike as I am not experienced enough to help directly. Have you tried the +trace switch? use SOAP::Lite +trace; Also there is the yahoo group to try. Sorry if I am stating the obvious. Thanx, Dp. On 8 Jun 2007 at 12:02, Mike Blezien

Algorithm or module needed

2007-06-01 Thread Beginner
Hi, I am trying to copy some file from a removable HDD to a network drive. I want replicate the directory structure and omit un-needed files. The directory paths a 4-5 levels deep and I am trying to work out an efficient way to recreate the directory path. What I've been doing is using

Re: Algorithm or module needed

2007-06-01 Thread Beginner
Thanx that's done exactly what I wanted. Dp. On 1 Jun 2007 at 16:34, Xavier Noria wrote: On Jun 1, 2007, at 4:29 PM, Beginner wrote: Hi, I am trying to copy some file from a removable HDD to a network drive. I want replicate the directory structure and omit un-needed files

module namespace

2007-05-04 Thread Beginner
Hi, I am using 2 modules under the GGI tree. If I remove CGI and use CGI::ProgressBar, am I importing all the methods from the CGI module still? My experiments suggest not but I thought I read that @INC will search up the tree. If I do this #use CGI qw/:standard/; use CGI::ProgressBar

CGI OO style

2007-05-04 Thread Beginner
Hi Again, I am trying to make a progressbar and am stuck. I might not sure if it my lack of understanding of the differences between the OO style or function-oriented style (to paraphrase the Stein-monster) of writing CGI scripts. Script 1 uses the function style and works albeit with one

Re: Regexp

2007-04-25 Thread Beginner
On 25 Apr 2007 at 18:58, Somu wrote: why wont the following work? $q = shift; $p = pass; if ( $q =~ m/$p/i ) { print 'match' } But it works on changing the $q and $p places.. Not sure but it works for me. #!/bin/perl use strict; use warnings; my $q = shift; my $p = pass; if (

A little bit of SOAP

2007-04-20 Thread Beginner
Hi, I am trying my hand a SOAP::Lite and wanted some enlightenment. I have created a test file (soaptest.pl) which acts as a server. soaptest has a subroutine called ReNameTiff which needs 2 arguments, a path to the original file and a new name for the file. Because SOAP::Lite is OO strange

Re: Problems installing XML modules

2007-04-19 Thread Beginner
Hi, On 19 Apr 2007 at 12:21, Kaptein, A.M. wrote: Hello, I just started using Perl,and I want to install some module to handle XML files. Below is the error message I get. Could someone help me ? Please tell me if you need some more information about the problem. Thanks,

Re: Uninstalling perl module

2007-04-13 Thread Beginner
On 13 Apr 2007 at 6:28, [EMAIL PROTECTED] wrote: Hi, I am using cpan to install modules. From time to time I have to uninstall a module. Untill now I did not find a tool to do it. Is there an official tool for this? Try this. It's not a tool but it is the Offical way to remove a

Can I map this

2007-04-04 Thread Beginner
Hi All, I have a list of names all in uppercase that I would like to capitaIise. I can't help but think that map could make short work of this loop but I am not sure how. Is it possible to use map here instead of a for loop? I can see there are going to be issues with double-barrelled names

Trying to make things portable

2007-04-02 Thread Beginner
Hi, I am trying to group some common subroutines into a module. As I use both Win32 and *nix systems I wanted the the routines that use the file system to be able to work in both environments and handle paths like /var/path/to/dir and h:\home\dir equally well. I know that perl will treat

XML parsing REST responses

2007-03-29 Thread Beginner
Hi, I might be in above my head here so bear with me if I am not making sense. I have to retrieve and extract an xml fragment from a REST server. I have followed some examples from the Web Services book. I am able to retrieve the data via LWP::UserAgent but I am baffled by the hash ref

Re: To Reference or not to reference

2007-03-29 Thread Beginner
Hi On 29 Mar 2007 at 12:51, Dukelow, Don wrote: I've written a Perl program that declares a hash at the top of the program %myHask;. It has worked great until now when one sub program seams to be making its own copy of the hash. I can find no typo's or anything but there my still be one

Re: XML parsing REST responses - RESOLVED

2007-03-29 Thread Beginner
On 29 Mar 2007 at 12:39, Beginner wrote: Hi, I might be in above my head here so bear with me if I am not making sense. I have to retrieve and extract an xml fragment from a REST server. I have followed some examples from the Web Services book. I am able to retrieve the data via LWP

Regex problem with accented characters

2007-03-27 Thread Beginner
Hi, I am trying to extract the iso code and country name from a 3 column table (taken from en.wikipedia.org) and have noticed a problem with accented characters such as Ô. Below is my script and a sample of the data I am using. When I run the script the code beginning CI for Côte d'Ivoire

Re: How do I generate a hash from an xml document?

2007-03-26 Thread Beginner
On 26 Mar 2007 at 11:55, Dave Adams wrote: What are the general steps to building a hash from and xml document? Here are my steps: 1. Read in xml document using XML::Simple 2. Create and empty hash 3. Loop through $VAR1 (the anonymous datastructure) and populate hash Is this the

Re: escape character

2007-03-22 Thread Beginner
On 21 Mar 2007 at 20:05, Dr.Ruud wrote: Beginner schreef: The Iconv route hasn't been too successful either. I tried Text::Iconv-new('ISO8859-1','utf8'); Thinking that my data is currently ISO8859-1but the results were not as I had hoped. Where I had MICROSCÓPIO, I got MICROSCÃPIO

RE: Some basic perl queries

2007-03-22 Thread Beginner
On 22 Mar 2007 at 8:59, Kumar, Akshay wrote: Thanks for the people who responded to original query. Another related query. Whats the best way to specify common set of include library directories, so that I don't end up including (use lib OR -I) in each file using my local modules. (recursive

Re: tiff images

2007-03-21 Thread Beginner
On 20 Mar 2007 at 19:46, Chris Parker wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rob Dixon wrote: Chris Parker wrote: Hello all, How do I get text out of a tiff image? Scenario is that I have alot of directories named (ex. 000, 020, 000) with files inside along the

Re: How to add a dir to @INC

2007-03-21 Thread Beginner
On 21 Mar 2007 at 17:05, kilaru rajeev wrote: Hi, Can anybody help me to add a directory to @INC variable? Thanks, Rajeev Kilaru Either of these should work. Put them at the top, before you use something from somedir. 1) use lib '/path/to/somedir'; 2) unshift @INC,

Re: escape character

2007-03-21 Thread Beginner
On 20 Mar 2007 at 12:55, Chas Owens wrote: On 3/20/07, Beginner [EMAIL PROTECTED] wrote: Hi, I have a large, 1.3GB xml file that I was trying to validate. It turns out that the file has a lot of exotic characters in it such as: é è Ä È ...etc Being a lazy kidda guy, I though

Re: How to add a dir to @INC

2007-03-21 Thread Beginner
On 21 Mar 2007 at 0:00, Jeff Pang wrote: 1) use lib '/path/to/somedir'; 2) unshift @INC, '/path/to/somedir'; This can't work when you add a path to @INC on runtime. BEGIN { unshift @INC,'/path/...'; } Do you mean you have to put it in a BEGIN block to work? Thanx, Dp.

escape character

2007-03-20 Thread Beginner
Hi, I have a large, 1.3GB xml file that I was trying to validate. It turns out that the file has a lot of exotic characters in it such as: é è Ä È ...etc The area of encoding and internationalisation is one I have no experience of at all and from what I've heard it is rather complex and

Sys::Gamin install error

2007-03-15 Thread Beginner
Hi, OS: FC4 With gamin-0.1.1-3.FC4 and gamin-devel-0.1.1-3.FC4 installed I have hit an error while trying to install Sys::Gamin. I can can run make but the `make test` is failing. The test file for Sys::Gamin reads: use Test; use SGI::FAM; plan tests = 1; ok (SGI::FAM::FAMChanged !=

sprintf - Rounding down

2007-03-15 Thread Beginner
Hi, For some reason my sprintf usage is not returning the numbers I had expected and appears to be rounding down. Is there something wrong with my formatting below. === code snip == my ($x,$y) = imgsize($fqn); my $size = $x*$y*3; my

Re: sprintf - Rounding down

2007-03-15 Thread Beginner
On 15 Mar 2007 at 8:05, Tom Phoenix wrote: On 3/15/07, Beginner [EMAIL PROTECTED] wrote: For some reason my sprintf usage is not returning the numbers I had expected and appears to be rounding down. Is there something wrong with my formatting below. my $ksize

Re: Sys::Gamin install error

2007-03-15 Thread Beginner
On 15 Mar 2007 at 8:20, Tom Phoenix wrote: On 3/15/07, Beginner [EMAIL PROTECTED] wrote: I have hit an error while trying to install Sys::Gamin. I can can run make but the `make test` is failing. BEGIN failed--compilation aborted at t/gamin.t line 2. t/gamindubious Test

polling a directory

2007-03-14 Thread Beginner
Hi, I am trying to find a means of monitoring a directory for activity. I would like a perl process to aware if a file has been dropped into a specific folder and then take some action. In the past I have used cron for this but I was thinking this isn't the best choice because 1) You have to

Query regarding seek and tell

2007-03-12 Thread Beginner
Hi, When I ask for the filehandle position (tell) it is reporting the pointer as being a few bytes further along than I expect it to be. For instance if I do this: #!/bin/perl use strict; use warnings; my ($start,$d,$var); my $file = 'myjpeg.jpg'; open(FH,$file) or die Can't open $file:

Re: Query regarding seek and tell

2007-03-12 Thread Beginner
On 12 Mar 2007 at 9:34, Tom Phoenix wrote: On 3/12/07, Beginner [EMAIL PROTECTED] wrote: When I ask for the filehandle position (tell) it is reporting the pointer as being a few bytes further along than I expect it to be. binmode(FH); while (FH) { If it's a binary file, you

Re: Removing blank lines

2007-03-12 Thread Beginner
On 12 Mar 2007 at 11:09, Grant wrote: Hello, I'm having a lot of trouble figuring out how to remove blank lines from my HTML. The lines are generated by my shopping cart. I use (and highly recommend) interchange: http://www.icdevgroup.org I basically want to wrap all of my code in

Re: Query regarding seek and tell

2007-03-12 Thread Beginner
On 12 Mar 2007 at 10:49, Tom Phoenix wrote: On 3/12/07, Beginner [EMAIL PROTECTED] wrote: What I am tring to do is find the x and y dimension of a jpeg Ah, Image::Size. http://search.cpan.org/~rjray/Image-Size-3.01/lib/Image/Size.pm Enjoy! Image::size Image::Info

Re: centralized variable variables

2007-03-06 Thread Beginner
On 6 Mar 2007 at 6:08, Jeff Pang wrote: Is it possible to send an variable (through the env or as an argument, or ) so I can use the variable $dir from the module test.pl to set the variable $vardir in param.pl. ?? Yes you can. You may declare the vars wanted to be shared in the

Centralised variables - different issue

2007-03-06 Thread Beginner
Hi, Following on from the earlier thread about storing common code in a central file, I have hit a problem when trying to do something similar. I have been toying with SOAP. There seems to be a number of ways to create SOAP services and I opted for one of the examples at guide.soaplite.com.

SOAP query

2007-03-05 Thread Beginner
Hi, I am trying to get started with SOAP. I am using mod_perl::Registry, the server script is below. I want to verify that the number of arguments being passed to the server is correct. In the snip below I presumed all the arguments would be items with @_ but it looks like all the arguments

Re: Off-Topic: Is the Randall Schwartz of Perl Fame?

2007-03-05 Thread Beginner
Mega. About time too. On 5 Mar 2007 at 11:56, Mathew wrote: http://articles.techrepublic.com.com/2100-1009_11-6164113.html?tag=nl.e019 Mathew -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: URL too long

2007-02-28 Thread Beginner
I think GET request are restricted to 256 characters, try using POST instead. HTH, Dp. On 28 Feb 2007 at 18:57, Tatiana Lloret Iglesias wrote: Hi all, i have to browse a very long URL from my PERL script and it fails:

Re: URL too long

2007-02-28 Thread Beginner
very long url's ... how can I use POST from Perl code? do you have any example? Thanks! T On 2/28/07, Beginner [EMAIL PROTECTED] wrote: I think GET request are restricted to 256 characters, try using POST instead. HTH, Dp. On 28 Feb 2007 at 18:57, Tatiana Lloret Iglesias

A long shot

2007-02-28 Thread Beginner
Hi All, This is a long shot. I have a list of files: hash.buckets page.index page.wordlist word.list word.index hash.file They are part of a SQL/Apache/mod_perl installation and these are some kind of indices for searches. I want to examine the contents if possible. It's quite possible

Re: A long shot

2007-02-28 Thread Beginner
On 28 Feb 2007 at 9:58, Tom Phoenix wrote: On 2/28/07, Beginner [EMAIL PROTECTED] wrote: I have a list of files: hash.buckets page.index page.wordlist word.list word.index hash.file They are part of a SQL/Apache/mod_perl installation and these are some kind of indices

Record separator and regex switch

2007-02-26 Thread Beginner
Hi, I am trying to parse some dhcp-lease files to extract the ip, mac and hostname. I am struggling to get either, the regex of the $/, correct. I am not sure which combination of these I should use. There is some sample data and my best effort below. Can anyone offer any pointers? TIA,

Re: Record separator and regex switch

2007-02-26 Thread Beginner
On 26 Feb 2007 at 15:58, D. Bolliger wrote: Beginner am Montag, 26. Februar 2007 14:50: Hi, Hi I am trying to parse some dhcp-lease files to extract the ip, mac and hostname. I am struggling to get either, the regex of the $/, correct. I am not sure which combination of these I

  1   2   >