AW: Subroutine

2010-10-11 Thread Thomas Bätzler
Jyoti jcutiep...@gmail.com asked: Can anyone help me out to call all subroutines from different .pm files in a specific directory please? Maybe if you were a bit more specific about what you're tyring to do. Maybe you want to start out by looking at

AW: testing tcp connection

2010-09-01 Thread Thomas Bätzler
Kammen van, Marco, Springer SBM NL marco.vankam...@springer.com asked: I have an issue when something goes wrong with the client that's trying to connect. 9 out of 10 times this works fine, but there are odd situations where $clientip doesn't get filled in, which leaves me with a connection

AW: Data migration

2010-07-27 Thread Thomas Bätzler
Shlomi Fish shlo...@iglu.org.il wrote: My suggestion is to simply copy the appropriate lines from the /etc/passwd to the new /etc/passwd. ... and of course not to forget about /etc/shadow because otherwise you won't be able to login. HTH, Thomas -- To unsubscribe, e-mail:

AW: array to hash array

2010-07-26 Thread Thomas Bätzler
Sharan Basappa sharan.basa...@gmail.com asked: Can someone tell me how to convert an array to hash. Each array entry has a row of values e.g. a(0) = ab cd ef; a(1) = mn de fg The hash array needs to be constructed with one of the element in the array row as the key. e.g. hash{ab} = cd ef

AW: hash arrays

2010-07-26 Thread Thomas Bätzler
Hi, Sharan Basappa sharan.basa...@gmail.com asked: I am reusing a code for some enhancements. According to my understanding, it is a record with some unique string as key and then hash array as the value. I iterate through the array and print as follows: foreach my $key (keys %{$abc}) {

AW: Compare file/dir size

2010-07-23 Thread Thomas Bätzler
file to get the stat would not be overly elegant!? I'll stand corrected... You could run sha1sum (or md5sum or whatever you have) on the list of files you transferred, then comparte the output of both runs. MfG, Thomas Bätzler -- BRINGE Informationstechnik GmbH Zur Seeplatte 12 D-76228 Karlsruhe

AW: Query on Qunatifiers

2010-07-15 Thread Thomas Bätzler
Chandan Kumar chandan_28...@yahoo.com asked: I have query over quantifiers. Could you please explain the combination of operators Question mark (?),dot(.),star(*),plus(+). Say this is my string: $_ =  this is my first pattern ,quite confused with quantifiers ex: (thi.*?) or

AW: question abt array

2010-06-30 Thread Thomas Bätzler
Chaitanya Yanamadala dr.virus.in...@gmail.com asked: i am in a situation like i have a scalar $value = 5 now i need to create an array with the number i mean $value how can i do it?? Don't even think about messing with the symbol table, use a hash variable instead: my %hash;

AW: Multi page form - cgi

2010-06-28 Thread Thomas Bätzler
Herb patyoun...@hotmail.com asked: I've been working on putting together a multi-page form in a single perl script. I have everything working as a single page form (writing to mysql database and emailing the output upon submit) but have not had any luck breaking the form into multiple pages.

AW: Multiple background processes

2010-06-24 Thread Thomas Bätzler
HACKER Nora nora.hac...@stgkk.at asked: I am currently having an issue with background processes. I already searched the web and found a way how to principally send a process into background, wait for the execution to finish and then go on with the main program: my $pid = fork; if ( $pid )

AW: A subroutine to find every occurrence of a substring in a string?

2010-06-10 Thread Thomas Bätzler
Peng Yu pengyu...@gmail.com asked: I can't find an existing perl subroutine (in the library) to find every occurrence of a substring in a string. The following webpage Example 3b. How to find every occurrence uses a loop to do so. But I'd prefer a subroutine. Could you let me know if such a

AW: Perl file with arguments

2010-06-09 Thread Thomas Bätzler
Gopal Karunakar gk.kalipuray...@gmail.com asked: How can i declare a simple perl script file which will take arguments from the user? an example will be take two numbers and give the sum as output. Do you want to pass the arguments on the command line or prompt for them after starting

AW: an odd conditional statement

2010-06-09 Thread Thomas Bätzler
sillymonkeysoftw...@gmail.com sillymonkeysoftw...@gmail.com asked: I'm working with some customizable data from a config file, and can't for the life of me figure out how to test conditionals from an external source. Does anyone have an idea how to accomplish something like: my

AW: Value betwwen quotes

2010-06-04 Thread Thomas Bätzler
Chaitanya Yanamadala dr.virus.in...@gmail.com asked: i have a string like this ComposedBlock ID=ZONE1-2 STYLEREFS=PAR1 HEIGHT=1062 WIDTH=1986 HPOS=573 VPOS=3003 i need to get the values between the after the ID= . So how can i do it, Can any one help me?? Assuming the string is on a

AW: Find duplicates in an array

2010-06-02 Thread Thomas Bätzler
Gopal Karunakar gk.kalipuray...@gmail.com asked: I needed to find all the duplicate values in an array and their count of occurences. Any help would be appreciated . #!/usr/bin/perl -w use strict; my @array=qw(foo baz bar foo baz foo); my %seen; foreach my $item (@array){ $seen{$item}++ }

AW: Developer docs

2010-05-28 Thread Thomas Bätzler
Hi, Steve Bertrand st...@ipv6canada.com asked: Is there a POD system that can be used exclusively for 'developer' documentation? Can I make devel docs 'hidden' from the rest of the POD? If not, can you recommend a decent practice that I can weave into my current documentation methodology so

AW: Using Arrays and if loops together

2010-05-27 Thread Thomas Bätzler
Hello Niall, niallheavey niallhea...@gmail.com wrote: I'm very new to perl but I will try to explain where I am at the moment. Providing sample input and output is fine. However, if you need help with your code people here have to be able to look at it. Try and post a minimal example for the

AW: Good/best practice - pre-declare variables

2010-05-21 Thread Thomas Bätzler
HACKER Nora nora.hac...@stgkk.at wrote: Obviously, my point wasn't clear enough, I'm sorry for that. The variable in the code extract that I'm really bothering about is the $sdb: It is needed in the SWITCH of a sub-function, but this construct only works if I pre-declare the $sdb in the

AW: print sub code

2010-05-21 Thread Thomas Bätzler
Tech list tech_l...@womenshealth.com asked: Let's say I have a module XYZ with a sub in it call ABC. I'd like to print the source code of XYZ::ABC. My reason for this is I accidentally overwrote a module with an older version, but I still have httpd running which has it loaded in memory.

AW: data dumper

2010-05-17 Thread Thomas Bätzler
. OTOH, it's easier to shoot yourself in the foot that way. MfG, Thomas Bätzler -- BRINGE Informationstechnik GmbH Zur Seeplatte 12 D-76228 Karlsruhe Germany Fon: +49 721 94246-0 Fon: +49 171 5438457 Fax: +49 721 94246-66 Web: http://www.bringe.de/ Geschäftsführer: Dipl.-Ing. (FH) Martin Bringe

AW: Hash with variable name

2010-05-12 Thread Thomas Bätzler
HACKER Nora nora.hac...@stgkk.at wrote: The script is being started with a parameter $stp (among others) that can be one of mvb/pkv/av/be/vvw. This parameter is used as a key for a master hash the values of which are names of other hashes themselves. # Master-Hash my %stp_dirs = ( mvb =

AW: Hash with variable name

2010-05-12 Thread Thomas Bätzler
HACKER Nora nora.hac...@stgkk.at asked: Try: my %stp_dirs = ('mvb' = \%mvb_dirs, 'pkv' = \%pkv_dirs, 'av' = \%av_dirs, 'be' = \%be_dirs, 'vvw' = \%vvw_dirs ); while ( my($sdir,$tdir) = each

AW: Hash with variable name

2010-05-12 Thread Thomas Bätzler
HACKER Nora nora.hac...@stgkk.at asked: Thanks for your explanation and the reference to perldoc, I understand now. But it doesn't work yet, I still get the same error. I have altered my source now as follows: my %stp_dirs = ( mvb = \%mvb_dirs, pkv =

AW: fork, read from child process and timeout

2010-05-11 Thread Thomas Bätzler
Weizhong Dai weizhong@gmail.com asked: - $pid = open(README, program arguments |) or die Couldn't fork: $!\n; while (README) { # ... } close(README) -- my problem is: I read from README, but if waiting for next

AW: sort hash with an array as the value

2010-05-11 Thread Thomas Bätzler
Owen rc...@pcug.org.au asked: I have this statement; foreach my $key ( keys %filehash ) { print $key $filehash{$key}-[0]\t\t\t$filehash{$key}-[3]\t $filehash{$key}-[2]\t $filehash{$key}-[1]\n; } but wish to sort the output by $filehash{$key}-[0]. Is it possible? How do I do this?

AW: IMAP email client: style security

2010-05-10 Thread Thomas Bätzler
Eitan Adler li...@eitanadler.com wrote: I wrote a program to fetch email from a IMAP account, look to see if I sent it, if yes execute any commands in the email and email the results back to via a SMTP server. [...] 2) Secondly since this program executes commands from a potentially insecure

AW: Remove and substitute character in a string with a regex

2010-05-10 Thread Thomas Bätzler
Finalfire blog.h...@gmail.com asked: Hello guys! I'm skilling regex using Perl and i've some trouble about a simple try: i've a string like: $string = HELLAAABB; and i want to manipulate in that way: HELL4O3ABB4C;You can simply notice that when i have 3 or more occurrences of a

AW: AW: Remove and substitute character in a string with a regex

2010-05-10 Thread Thomas Bätzler
Hi Shlomi, use warnings is preferable to the -w flag. Not in my book. The command line switch turns on warnings globally, whereas the use warnings; pragma only enables them in the current lexical scope. So by using the command line switch, I get warnings about crappy third-party code, too.

AW: about dispatch tables

2010-05-06 Thread Thomas Bätzler
Harry Putnam rea...@newsguy.com asked: But even though I can work with that... I'm still not seeing why the values in @_ are not available at the call to N() inside like this: (incomplete code) func($val1,$val2); sub func { %h = ( N = sub { print N(@_) . \n; } ); } If you call the sub

AW: Directory sizes

2010-05-05 Thread Thomas Bätzler
getting additional options that way. MfG, Thomas Bätzler -- BRINGE Informationstechnik GmbH Zur Seeplatte 12 D-76228 Karlsruhe Germany Fon: +49 721 94246-0 Fon: +49 171 5438457 Fax: +49 721 94246-66 Web: http://www.bringe.de/ Geschäftsführer: Dipl.-Ing. (FH) Martin Bringe Ust.Id: DE812936645, HRB

AW: How to Decode UDP packets got from libpcap using Net::Pcap

2010-05-05 Thread Thomas Bätzler
perl perlatw...@gmail.com asked: I have used libpcap to capture data using Net::Pcap module [...] This is an UDP DNS Query How can i Decode them ... Any one Please help me http://www.net-dns.org/docs/Net/DNS/Packet.html HTH, Thomas -- To unsubscribe, e-mail:

AW: Array, foreach problem

2010-05-05 Thread Thomas Bätzler
Brian fulls...@me.com asked: foreach $line (LOGFILE) { while (my $line = $logfile) would be a better idea than foreach $line. Just curious for an explanation to this. I tend to use foreach too. Don't they both accomplish the same thing? :) foreach (LOGFILE) means that the

AW: about dispatch tables

2010-05-05 Thread Thomas Bätzler
Harry Putnam rea...@newsguy.com asked: [...] which is also inside sub dispt {the sub function}. Where does global come in? Hint: $code-(@_); HTH, Thomas -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

AW: sendmail arguments

2010-04-29 Thread Thomas Bätzler
John Bruin john.br...@nec.co.nz asked: I have inherited a Perl script which sends and parses email. I am having trouble trying to figure out what the -oi and -oem arguments do in the sub below. Can anyone help? -oemode sets the ErrorMode. From

AW: Interactive shell in Perl

2010-04-28 Thread Thomas Bätzler
Parag Kalra paragka...@gmail.com asked: Wanted to know if Perl has any interactive shell (just like Python, Bash, Ruby etc have) by any chance. And if yes how do we invoke that. Since you mentioned bash, the zoidberg shell might be an option:

AW: get path to linked directory

2010-04-27 Thread Thomas Bätzler
Andreas Moroder andreas.moro...@sb-brixen.it asked: I have a entry in my directory that is a soft-link to another directory. Is there a way in perl to get, starting from the link, the path of the real directory ? http://perldoc.perl.org/Cwd.html#abs_path-and-friends HTH, Thomas -- To

AW: Perl rounding errors?

2010-04-26 Thread Thomas Bätzler
Rob Coops rco...@gmail.com asked: I am just wondering if I sumbled upon an error in perl an error in my logic or somehtign else see the below perl one liners $ perl -e '$n = 0.945; $r = sprintf(%.2f, $n); print $r\n;' 0.94 Short answer: You shouldn't use floating point numbers for financial

AW: why does this code fail with stat?

2010-04-22 Thread Thomas Bätzler
Harry Putnam rea...@newsguy.com wrote: I'm not finding a reference in perldoc File::Find showing how to set that flag when using the popular notation like the script involved here. Probably a case of not seeing the woods because of the trees ;-) To quote: NAME File::Find - Traverse a

AW: Newbie stuck at the first hurdle

2010-04-22 Thread Thomas Bätzler
Kryten kryte...@googlemail.com asked: This is embarrassing. All I want to do is read the content of a simple 10 line .txt file into an array and print out the lines, and I just can't seem to get it to work! /* $target = D:\testfile.txt; open NEWBIE, $target; @arr = WAWA; foreach $line

AW: Meta: Nice Perl?

2010-04-22 Thread Thomas Bätzler
HACKER Nora nora.hac...@stgkk.at asked: I wonder if some of you are in the same situation like me: I am the only Perl programmer in the company, at least trying hard to get along :-), but I have nobody to ask for help. So I spend hours and hours with my book and the internet when I'm stuck.

AW: AW: why does this code fail with stat?

2010-04-22 Thread Thomas Bätzler
Harry Putnam rea...@newsguy.com asked: I pointed to that exact piece of code then asked how to make that kind of options setting when using this format of find() find( sub { if(bla){ blabla } }, @dir ); That's not possible, since there is neither an option

AW: How to manage large Conditional Statement

2010-04-21 Thread Thomas Bätzler
Mimi Cafe mimic...@googlemail.com asked: I need to evaluate a statement in an if, elsif, else block, and the statement to evaluate in the elsif is too large as I need to run a SQL query and act on the return value. What would be a better way to achieve this? Putting the SQL statement

AW: Is there any method to tell different between warning and errors?

2010-04-20 Thread Thomas Bätzler
Jeff Pang armyw...@gmail.com wrote: On Tue, Apr 20, 2010 at 1:28 PM, Weizhong Dai weizhong@gmail.com wrote: Hi all, In my script, I have a system call, and redirect the stderr to a file.        #        # open STDERR, $workpath\\error_log.txt;        # system ...;        #

AW: Problems with show tech using the Net::Telnet Module

2010-04-20 Thread Thomas Bätzler
Asterix lange.gerh...@gmail.com asked: I've made a little script to capture the output of networking devices. Everything works fine, until I use the show tech command in an Cisco device. Have you considered using the cmd() method of Net::Telnet? It has the option to individually set a reply

AW: Can't locate object method TIEHASH via package Apache::Session::MySQL

2010-04-19 Thread Thomas Bätzler
suggestions are cargo cult programming. Please don't do that. As a rule of thumb, use single quotes if you're dealing with a literal string than you don't want/need to interpolate (substitute variables, escaped characters, etc.) and use double quotes otherwise. MfG, Thomas Bätzler -- BRINGE

AW: Writing Perl scripts to run on any OS'es

2010-04-19 Thread Thomas Bätzler
newbie01 perl newbie01.p...@gmail.com asked: Am wanting to change my Perl scripts to get it to run on several UNIX flavours and Windows. At the moment, the only way I can think of how to accomplish that is always having the following checks on each and every sub that I have. Can anyone

AW: Problem in installing ActivePerl 5.10 on Windows 7 with x64 chipset

2010-04-15 Thread Thomas Bätzler
Hi, Rene Schickbauer rene.schickba...@gmail.com wrote: For me, the msi packages worked quite well for the last few years. Altough i'm currently using the x86 versions due to some trouble with a few packages - mostly the ones that link to an external closed-source library, but i also had

AW: Copy file from one server to another

2010-04-14 Thread Thomas Bätzler
Chris Coggins cacogg...@cox.net asked: I need to copy a small config file from one server to another. I'm generating the file on one server with a pretty complex script. I need to put that file on another server for immediate user access via html. I've tried just writing the file straight to

AW: Perl get host's IP

2010-04-14 Thread Thomas Bätzler
pen...@nsbeta.info asked: Is there a general way to get linux OS's bound ip addresses? for example, the IP on eth0, eth1 etc. Thanks. http://search.cpan.org/~lds/IO-Interface-1.05/Interface.pm could be a good enough solution for you. I say good enough since it gives you all of the info that

AW: html print

2010-04-12 Thread Thomas Bätzler
Chris Coggins cacogg...@cox.net asked: I'm having trouble getting a piece of data from a form input to print in html. Here's the relevant portion of my code sub subroutine { my($hash) = shift; my($data) = $hash-{'expl'}; print Content-type: text/html\n\n; print STOPHTML; div

AW: Date calculation help/suggestion please ... when there is no Date or Time module available

2010-04-08 Thread Thomas Bätzler
newbie01 perl newbie01.p...@gmail.com wrote: Problem 1: - Is there a function to compare the two (2) dates so ensure that I will always be doing future_date-past_date? At the moment, the workaround that am doing is if I get a negative value, then that means, I've done a past_date-future_date

AW: String length limits?

2010-04-08 Thread Thomas Bätzler
Hi, Chris Coggins cacogg...@cox.net asked: Is there a limit to the length of a string in perl? I'm combining about 200 pieces of data into a single string and writing the string to a file and am getting some weird behaviors every once in a while. Does perl have a limit on the length of a

AW: about beginner perl site and developing skill

2010-04-08 Thread Thomas Bätzler
What is a CMS? http://en.wikipedia.org/wiki/Content_management_system What is meant by chipcards? http://en.wikipedia.org/wiki/Chip_card HTH, Thomas -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

AW: Perl: Subroutines and use of the GD::Graph::bars; Module

2010-04-07 Thread Thomas Bätzler
alekto alekto.antarct...@gmail.com asked: I manage to generate the array from the input file, but it seems like there is something wrong with my subroutine at the end, I have been using the examples at cpan.org as an templat for this subroutine. Following is the error msg, as well as the

AW: Converting 12 hour time format to 24 hour format ... a bit urgent

2010-04-07 Thread Thomas Bätzler
newbie01 perl newbie01.p...@gmail.com asked: Unfortunately, I suddenly have to to deal with an input file where the datetime format is 02-Apr-2010 3:41:23 p.m., i.e. DD-MON- HH:MI:SS a.m./p.m., so now my Delta_YMDHMS does not work as expected. You can convert from a.m./p.m. to standard 24

AW: about the various styles of `open'

2010-04-06 Thread Thomas Bätzler
Harry Putnam rea...@newsguy.com asked: I see advanced users here using various styles of open(). [three argument open] Is there something beyond style that makes those methods better than what appears to be a simpler format: [two argument open] Allow me to quote perldoc -f open:

AW: Working with files of different character encodings

2010-04-06 Thread Thomas Bätzler
Doug Cacialli doug.cacia...@gmail.com asked: Does anyone have any ideas how I can make the second block of code work? Or otherwise accomplish the task without opening the .txt file twice? How large are your data files? If your available memory is much larger than your maximum file size, you

AW: Perl appears to be introducing whitespace when reading .txt files

2010-04-01 Thread Thomas Bätzler
this snipped in your code: print NUL character found in string - input might be UTF-16\n if $line =~ m/\x00/; MfG, Thomas Bätzler -- BRINGE Informationstechnik GmbH Zur Seeplatte 12 D-76228 Karlsruhe Germany Fon: +49 721 94246-0 Fon: +49 171 5438457 Fax: +49 721 94246-66 Web: http://www.bringe.de

AW: Syntax of Foreach loop

2010-03-31 Thread Thomas Bätzler
Jon Forsyth jon4s...@gmail.com asked: I am truly a beginner. Could someone help me understand this syntax out of a code example from Learning Perl? On line 5 I'm confused as to why my $number is between foreach and the ()? is my $number part of the loop? my declares a variable for the

AW: AW: Syntax of Foreach loop

2010-03-31 Thread Thomas Bätzler
Uri Guttman u...@stemsystems.com wrote: TB == Thomas Bätzler t.baetz...@bringe.com writes: TB with the -w switch or the use warnings; pragma which requires TB variables to be declared before their first use. that is the use strict pragma, not the warnings one. Of course. I knew I

AW: Perl appears to be introducing whitespace when reading .txt files

2010-03-31 Thread Thomas Bätzler
Doug Cacialli doug.cacia...@gmail.com wrote: I'm completely baffled by this and not entirely sure where to start. I have a plain text file, testfile.txt, which contains a single line: Could this be an encoding issue? How big is that file? Larger than 18 or 19 bytes? If yes,

AW: Storing a Hash Inside An Array

2010-03-26 Thread Thomas Bätzler
Pry, Jeffrey jeffrey@sig.com asked: Now, I was wondering if it would be possible to store a hash inside of an array. Sure, just use the anonymous hash constructor {}, i.e. like $settings[$i] = { 'ftpserver' = localhost, 'password' = 'p...@$$word' }; Or add/change individual keys in the

AW: Regex question

2010-03-24 Thread Thomas Bätzler
Bruce Ferrell bferr...@baywinds.org wrote: if ( ! defined $username || ! $username =~ /[0-9]{10,11}/ ) { do something; } else { do something else; } what that's supposed to do is this: if it's blank or not 10 or 11 digits... The question is where is my understanding faulty or

AW: Deleting last 10 lines of a file

2010-03-23 Thread Thomas Bätzler
sheela b sheela.b.2...@gmail.com asked: How to delete last 10 lines of a file using Perl one liner? I used the following one liner to delete first 10 lines of a file, perl -i.bak -ne 'print unless 1..10' test.txt OTTOH: perl -i.bak -ne 'BEGIN { $b[9]= } print shift @b; push @b,

AW: CGI-BIN Help/Advise - editing a file - HOW ?

2010-03-15 Thread Thomas Bätzler
newbie01 perl newbie01.p...@gmail.com asked: At the moment, I have some sort of INI/config file that I edit manually via vi. These config files are simple delimited file that are used by some of the scripts running on the server. I want to be able to the same thing via cgi-bin, can anyone

AW: Please excuse the NOOB question - but I guess since this is a perl.beginners group

2010-02-26 Thread Thomas Bätzler
Hi, GlenM glenmill...@gmail.com wrote: I am sure that someone out there has done this before - I *think* I am on the right track. I have a directory full of emails. What I would like to do is read each file in, then parse them into a CSV style file. Quick aside: you can use the $. builtin

AW: newline problem

2010-02-01 Thread Thomas Bätzler
Michom michel.makhlo...@gmail.com asked: I am new to perl and I have written a smal script to grab data from one file, and put them into another file. The problem is new lines, which are printing nice under a linux environment, but it is all messed up if I open it with notepad. I am running

AW: Warning: Use of uninitialized value

2010-01-28 Thread Thomas Bätzler
Bob Williams n...@spam.barrowhillfarm.org.uk asked: I am trying to split the lines in a file into two halves (at the first space) each half going into an array. The code I have written is below. ---Code--- #!/usr/bin/perl use warnings; #use strict; use strict; # unless you know what you're

AW: passing a hash via cookie and dereferencing it

2010-01-19 Thread Thomas Bätzler
mike msmspellman...@gmail.com asked: I am trying to pass a hash of hashes from one script to another via a cookie. I can get the cookie to pass, but when I try to get the inner hash keys and values using what I think is the correct method, I cannot get them. Here are two scripts which should

AW: chroot as non-root?

2010-01-04 Thread Thomas Bätzler
Trevor Vallender t...@tsv.me.uk asked: I am designing a system in which scripts are installed into their own directory, by a non-root user, under their home directory. It is very important they not be allowed to write anywhere outside the directory they are installed in. There are two ways I

AW: :POP3 -- download only x number of mails

2009-12-13 Thread Thomas Bätzler
Agnello George agnello.dso...@gmail.com asked: I am planning to use the Net::POP3 module to downald a mail box and then pass the mails via a parser . I would like to know if the there is a option to downlod only a certin number ( 100 ) of mails [unread] and then mark the mails as read .

AW: how to automate yum installation

2009-12-07 Thread Thomas Bätzler
instead. MfG, Thomas Bätzler -- BRINGE Informationstechnik GmbH Zur Seeplatte 12 D-76228 Karlsruhe Germany Fon: +49 721 94246-0 Fon: +49 171 5438457 Fax: +49 721 94246-66 Web: http://www.bringe.de/ Geschäftsführer: Dipl.-Ing. (FH) Martin Bringe Ust.Id: DE812936645, HRB 108943 Mannheim

AW: Regular expressions question

2009-11-18 Thread Thomas Bätzler
Hi, Dermot paik...@googlemail.com suggested: 2009/11/17 mangled...@yahoo.com mangled...@yahoo.com: Can anyone tell me hoq to write a regular expression which matches anything _except_ a litteral string ? For instance, I want to match any line which does not begin with Nomatch.  So in

AW: Perl CGI Incremental find

2009-11-17 Thread Thomas Bätzler
Hi, Jeff Pang pa...@uk2.net wrote: On Nov 17, 2009, Dave Tang d.t...@imb.uq.edu.au wrote: Is it possible to implement an incremental find* feature on a Perl CGI page? I'm running Apache2 with mod_perl on linux. For example, if I have a list of stuff (A, Aa, B, Bb, C, CA, etc. stored

AW: foreach loop

2009-11-02 Thread Thomas Bätzler
Anant Gupta mailto:anantgupta...@gmail.com asked: In the foreach loop, without going to the beginning of the loop, i want to get the next iteration of data. How do i get it. You should probably not slurp (read in all at once) the file unless you need to. In your particular case reading in

AW: foreach loop

2009-11-02 Thread Thomas Bätzler
Philip Potter philip.g.pot...@gmail.com asked: Won't this loop terminate early if there is a blank line or a line containing only '0'? If I do a readline loop I always do: while (defined ($line = $file)) Is there something magical happening here I don't know about? I know about the magical:

AW: How do I pick one random element from an array?

2009-11-02 Thread Thomas Bätzler
Majian jian...@gmail.com asked: [...] print Array of random: $array[rand @array]\n; I thoght it might work but it doesnt. I hope someone could give me an idea to work this out... TIMTOWTDY: a) print Array of random: $array[rand( @array ) ] \n; b) print Array of random: . $array[rand

AW: AW: How do I pick one random element from an array?

2009-11-02 Thread Thomas Bätzler
Dave Tang d.t...@imb.uq.edu.au asked: Just a quick question, how does Perl interpret something like $array[0.7995038473872]? Just like $array[ int(0.7995038473872) ], i.e. the floating point number is coerced into an integer value by cutting off the decimal places. HTH, Thomas -- To

AW: About the hash case insensitive ~~~

2009-10-27 Thread Thomas Bätzler
Majian jian...@gmail.com asked: %courses = ( 2CPR2B= C Language, 1UNX1B= Intro to Unix, 3SH414= Shell Programming, 4PL400= Perl Programming, ); print \n\EDP\ NUMBERS AND ELECTIVES:\n; while (($num, $value) =

AW: Building a fmt line for printf with a carriage return

2009-10-26 Thread Thomas Bätzler
Hi, Wagner, David --- Senior Programmer Analyst --- CFS david.wag...@fedex.com wrote: Here is the sample script I was playing with: #!/usr/bin/perl use strict; use warnings; my $MyLine1 = q[%2d %5s %6s]; my $MyLine2 = q[%2d %5s \n%6s]; The q// operator is equivalent to single

AW: perl document

2009-10-26 Thread Thomas Bätzler
mahesh bhasme mbha...@gmail.com asked: I am new to perl. From where I get the basic perl document Depends on your distribution, really. If you're on Windows and using the ActiveState Perl distribution, look for the html folder in your Perl installation directory. On Unix, you might want to

AW: compact my wordlist generator

2009-10-26 Thread Thomas Bätzler
Michael Alipio daem0n...@yahoo.com wrote: Can anyone tell me how the code above works? My original program must deal with arbitrary length and generate all the possible combinations (even repeating) of a particular set. What could take me gazillions of for loops for that, somebody just came up

AW: AW: compact my wordlist generator

2009-10-26 Thread Thomas Bätzler
Michael Alipio daem0n...@yahoo.com wrote: I knew I needed a recursive function, I just didn't know how to start. That is usually the easy part - you start out by solving the problem for a base case, and then you embellish. With regard to your problem of generating all combinations of a set of

AW: Url written in txtfile

2009-10-05 Thread Thomas Bätzler
Hi, Ruprecht Helms rhe...@rheynmail.de asked: actually I have written the following line: Currently. actually is actually a false friend. print STATISTIKDATA CGI-a({href='http://www.b-net- c.de/adressbuch/$Vorname_$Name_$id.html'},'Link zum Profil'); You are using the wrong quote marks.

AW: Url written in txtfile

2009-10-02 Thread Thomas Bätzler
Ruprecht Helms rhe...@rheynmail.de asked: how have I to write the printstatement to write a URL like http://www.example.com within the htmltag (a href=http://www.example.com;Linktext/a) into a textfile. Hm, for example #!/usr/bin/perl -w use strict; my $file = '/some/path.txt'; my $text =

AW: Hash of Hashes

2009-09-29 Thread Thomas Bätzler
Soham Das soham...@yahoo.co.in asked: How can I create a Hash of Hashes from two lists. Is it possible? I want the effective functionality to be served like this $ChildHash[Joe][21A]=Sally i.e Joe at 21A has a child called Sally. List1 here will be the name of Parents, List2 here will

AW: Burnt Camel Club

2009-09-22 Thread Thomas Bätzler
Ian pcs...@gmail.com wrote: Keep it up and the hollier-than-though's will have the list to themselves eventually. What's holly got to do with it, though? ;-) SCNR, Thomas ;-) -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org

AW: CGI and persistent data (without Storable)

2009-08-28 Thread Thomas Bätzler
Steve Bertrand st...@ibctech.ca asked: I'm writing a web interface using CGI::Application for a project that houses numerous methods within a dozen modules. One particular process displays a template to the user with passed in data, and then has four more steps before completing. The result

AW: How to pass info to a CGI program without using a form?

2009-08-24 Thread Thomas Bätzler
Disclaimer: I haven't written Perl or a major book on it so this answer is strictly IMHO, OTTOH and of course YMMV ;-P boll b...@sonic.net asked: I would like to use this program in several places to display images from other directories, so that one URL might display a random image from the

AW: Trying to remove text in inverted commas.

2009-08-24 Thread Thomas Bätzler
Hello Gregory, Gregory Machin gregory.mac...@gmail.com asked: I'm writing a script to import logs into a Mysql .. My Perl is rusty and I'm battling with a convention on the one column. I need to remove the text in inverted commas Prashil 106 so that just the number 106 remains.. I have been

AW: WELCOME to beginners@perl.org

2009-08-21 Thread Thomas Bätzler
Ajay Kumar aku...@securities.com asked: Gesendet: Freitag, 21. August 2009 12:23 An: beginners@perl.org Betreff: RE: WELCOME to beginners@perl.org Hi All I have great issues 1) perl -e '$a=0.123451005;$a=sprintf(%.8f,$a);print=$a\n;' Output=0.12345101 2) perl -e

AW: fast installing modules

2009-08-18 Thread Thomas Bätzler
Jenn G. practicalp...@gmail.com asked: We have a project which has 30+ perl/modperl modules. Installing those modules by hand on each host is wasting time. So can we just copy the directory /usr/lib/perl5/ from the already installed host to any other not installed hosts? We use Linux OS,

AW: delete 20 000 records in oracle from perl

2009-08-17 Thread Thomas Bätzler
luke devon luke_de...@yahoo.com asked: Since i have more binary data to be deleted in the requested query , i have to use a external script/program to satisfy the deletion. So thats why i wanted to know , how can we implement multi threading for the situation. You said that CPU load is high

AW: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Thomas Bätzler
Wagner, David --- Senior Programmer Analyst --- CFS david.wag...@fedex.com asked: I have looked at perldoc -f open and tried a number of things. The line should be last line is appearing in my audittrail file, but I never see the EndOfProg or Error in the auditrrail or on the screen.

AW: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Thomas Bätzler
Amit Saxena learn.tech...@gmail.com asked: I want a perl ping script (console based) to monitor server up/down state. Why re-invent the wheel when there's already stuff like mon (http://mon.wiki.kernel.org/index.php/Main_Page) or nagios (http://www.nagios.org/)? HTH, Thomas -- To

AW: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Thomas Bätzler
Amit Saxena learn.tech...@gmail.com wrote: Hi Thomas, Thanks for the response. The client for which I am working will not allow any external utility / modules to be installed on their development / production environments. Moreover they want the solution implemented using Perl only.

AW: bug in perl?

2009-07-17 Thread Thomas Bätzler
Octavian Rasnita orasn...@gmail.com asked: I have tried the following calculation with ActivePerl 5.10.0 build 1004 under Windows XP Pro: print 0.79 - 0.798; And it gave the following result: -0.00801 which is obviously wrong. No, it isn't. Welcome to the wonderful world

AW: bug in perl?

2009-07-17 Thread Thomas Bätzler
Paul Johnson p...@pjcj.net wrote: On Fri, Jul 17, 2009 at 12:26:58PM +0200, Thomas Bätzler wrote: Octavian Rasnita orasn...@gmail.com asked: I have tried the following calculation with ActivePerl 5.10.0 build 1004 under Windows XP Pro: print 0.79 - 0.798; And it gave

AW: Time stamp in file name.

2009-07-08 Thread Thomas Bätzler
Meghanand Acharekar vasco.deb...@gmail.com asked: I am writing a perl script which creates a file (on Linux/UNIX) using system's date. e.g. log_2009-07-07.gz Here is the code I wrote. #!/usr/bin/perl -w use strict; # Prog for demostrating file name concatenations. $prefix=log;

AW: Edit text file using perl script

2009-07-07 Thread Thomas Bätzler
Alpesh Naik naik.alp...@gmail.com asked: I am trying to edit the text file using perl script. i want to replace a particular text of file with new text. but the problem is that the new text appeared at end of file; How can i solve this problem, pls. help We can help you much

  1   2   3   4   >