Hello All
It's been almost 13 years since I last posted on this board and my Perl skills
are extremely rusty. Could someone help me to convert this to a one liner:-
use strict;
use warnings;
while (<>) {
/^##\s*(.*)$/ && print $1;
print " && " unless eof;
}
Input file looks like this:-
Great. Thankyou chenxy.
-Original Message-
From: chenxy [mailto:tin...@gmail.com]
Sent: Friday, 13 March 2009 2:01 PM
To: Toby Stuart
Cc: beginners@perl.org
Subject: Re: one liner need help
2009/3/13 Toby Stuart < toby.stu...@figtreesys.com.au>
Hello All
It's been almo
WWW::Mechanize will do most if not all of what you need.
> -Original Message-
> From: Stuart White [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 17, 2004 8:06 AM
> To: [EMAIL PROTECTED]
> Subject: lexis nexis search module or script?
>
>
> I need to search a web database that has se
Hi All,
Been ages since I last posted to this list...
Anyhoo, I have a script which handles the uploading of a file.
It uses the CGI module to get the form params etc and open/read/close
statements to receive the file. This is fine and all works well. The
problem is a temporary file (of the s
> -Original Message-
> From: Babale Fongo [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 10:08 PM
> To: [EMAIL PROTECTED]
> Subject: CGI.pm / Upload File / delete temporary file (CGITemp)
>
>
>
>
>
> You don't have to bother about deleting it. GCI.pm takes care of that.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 21, 2004 2:57 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Perl2exe
>
>
> In article
> <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Manish U) writes:
> >Hi,
> >
> >Can any one give me the url where
> -Original Message-
> From: Marco Perl [mailto:[EMAIL PROTECTED]
> Sent: Monday, 12 July 2004 4:19 PM
> To: ; [EMAIL PROTECTED]
> Subject: Could you please help with a PERL/TK question.
>
>
>
> Hi, I developed a perl/TK script in Win-2000
> environment.
> when I run it the DOS-screen
look at the 'susbtr' function. it will do what you require
> -Original Message-
> From: Hawkes, Mick I [mailto:[EMAIL PROTECTED]
> Sent: Monday, 31 January 2005 3:32 PM
> To: beginners@perl.org
> Subject: operator equivalents
>
>
> All,
>
> Could someone please tell me the Perl equival
> -Original Message-
> From: SkyBlueshoes [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 23 May 2006 12:38 PM
> To: beginners@perl.org
> Subject: Create Directories
>
>
> Another stupid question, search.cpan.org doesn't like me, lol:
>
> Which module is best for creating a directory and al
> -Original Message-
> From: Japerlh [mailto:[EMAIL PROTECTED]
> Sent: Friday, 26 May 2006 11:21 AM
> To: beginners
> Subject: Help: Is there any way to get the name of the Window Server
> that the Perl script is currently running on?
>
>
> Help: Is there any way to get the name of the
> -Original Message-
> From: Sastry [mailto:[EMAIL PROTECTED]
> Sent: Monday, 31 July 2006 4:21 PM
> To: beginners@perl.org
> Subject: Major Applications of Perl
>
>
> Hi
> We know that Perl is used for various puposes including text
> manipulation,file maintenance and automation of sys
he number is <= 29 and then replace but would prefer a
single regex if possible.
Thanks
Toby Stuart
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
use binmode
my $png_data = get($http_request_string);
open ( OUTPUT_HANDLE, "> $path/top_n.png" );
binmode OUTPUT_HANDLE;
print OUTPUT_HANDLE $png_data;
close OUTPUT_HANDLE;
-Original Message-
From: Daniel Kasak [mailto:[EMAIL PROTECTED]
Sent: Monday, 15 August 2005 1:42 PM
To: begin
should probably have said 'look at the binmode function' rather than 'use
binmode' so as not to confuse with use'ing a module :(
-Original Message-
From: Toby Stuart [mailto:[EMAIL PROTECTED]
Sent: Monday, 15 August 2005 1:48 PM
To: 'Daniel Kasak'
C
> -Original Message-
> From: a b [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 9 February 2006 11:47 PM
> To: libwin32@perl.org; beginners@perl.org
> Subject: help required regarding Win32::OLE
>
>
> Hello all perl gurus,
>
> i'm sticking out with the issue of changing configuration of
> -Original Message-
> From: Avinash Sridhar [mailto:[EMAIL PROTECTED]
> Sent: Friday, 10 February 2006 5:41 AM
> To: beginners@perl.org
> Subject: A very basic question
>
>
> Hello All,
>
>I just joined this forum today and I dont know whether
> this particular
> question has been
> -Original Message-
> From: Jim [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 19 April 2006 10:52 AM
> To: beginners@perl.org
> Subject: Regex Help
>
>
> i am trying to match a '!' followed by any char but a '!' or no chars
> (string is only a '!')
>
> this is what I have and it is not w
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 28, 2004 11:51 AM
> To: [EMAIL PROTECTED]
> Subject: How to calculate elapsed time ?
>
>
> Hi all:
>
> I'm trying to determine how long an system operation takes.
> Anyone know
> of a
> -Original Message-
> From: John McKown [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 04, 2004 1:28 PM
> To: Perl Beginners Mailing List
> Subject: Program to reformat Perl code?
>
>
> I have some fairly ugly Perl code which I generated sort of
> ad-hoc from a
> "file descrip
> -Original Message-
> From: Wagner, David --- Senior Programmer Analyst --- WGO
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 06, 2004 9:38 AM
> To: Beginner Perl
> Subject: Using Perl to change information contained within a shortcut
>
>
[stuff snipped]
>
> Is there any P
> -Original Message-
> From: Wagner, David --- Senior Programmer Analyst --- WGO
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 06, 2004 10:13 AM
> To: Toby Stuart
> Cc: [EMAIL PROTECTED]
> Subject: RE: Using Perl to change information containe
> -Original Message-
> From: Mark Goland [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 13, 2004 1:28 PM
> To: [EMAIL PROTECTED]
> Subject: strings
>
>
> Hi All,
>
> I have a tring which contains 60 to 80 keywords, I need to
> know what position a keyword is in. I need an efficint
> -Original Message-
> From: Christian Wattengård [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 18, 2004 4:41 AM
> To: [EMAIL PROTECTED]
> Subject: Extracting data from html structure.
>
>
> I have the following html structure:
> ---
small modification below
> -Original Message-
> From: Toby Stuart [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 19, 2004 2:37 PM
> To: 'Christian Wattengård'; [EMAIL PROTECTED]
> Subject: RE: Extracting data from html structure.
>
>
> >
this is not a perl question. better posted to a HTML/javascript list.
nonetheless the following works ...
A
B
function updateSubCategory(sCategory)
{
var aSubCategories = new Array('A1','A2','B1','B2');
var oForm = document.forms[0];
how about the poor mans way ... Acme::Bleach
> -Original Message-
> From: Timothy Johnson [mailto:tjohnson@;sandisk.com]
> Sent: Friday, November 08, 2002 11:05 AM
> To: 'dan'; [EMAIL PROTECTED]
> Subject: RE: Securing/Encrypting Source
>
>
>
> If you just want to make it harder, you ca
> Hi,
>
> I am trying to write a script that copies an information from
> ACCESS but
> it gives me the following error:
>
> Can't call method "Sql" on an undefined value at
> franowner.pl.txt line 4.
>
> Here's the script:
>
>
> use Win32::ODBC;
> $DSN="db1";
> $db = new Win32::ODBC("db1");
> I need to get all the words in a query (q=___) out of a (URL, I think)
> encoded string.
>
> Example line and my current plan:
>
> $queryString =
> 'pp=20&q=Finance/Banking/Insurance&qField=All&qMatch=any&qSort
> =smart&view=1'
>
> my %querys = $queryString =~ /(\S+)=(\S+)&?/g ;
>
> #Here I
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 26, 2002 3:20 PM
> To: '[EMAIL PROTECTED]'
> Subject: Calculating currentdate without the time module
>
>
> Gidday all,
>
> The time module has not been installed on our server and our
> s
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 27, 2002 2:31 PM
> To: '[EMAIL PROTECTED]'
> Subject: Passing an array to a subroutine
>
>
> Hi all,
>
> I think somebody asked this the other day.
>
> How does one pass an array to
> -Original Message-
> From: Harry Putnam [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 16, 2002 3:15 PM
> To: [EMAIL PROTECTED]
> Subject: localtime question - zero padding - mnth discrepancy
>
>
>
> I really have two questions here:
>
> 1) How can I get padded numbers in the s
> -Original Message-
> From: Toby Stuart [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 16, 2002 4:17 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: localtime question - zero padding - mnth discrepancy
>
>
>
>
> > -Original Message
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 20, 2002 11:55 AM
> To: '[EMAIL PROTECTED]'
> Subject: Reg ex help!
>
>
> Gidday All,
>
> Im reading course names in from a text file and want to
> remove the course number from the end
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 13, 2003 1:25 PM
> To: [EMAIL PROTECTED]
> Subject: String Stripping?
>
>
> Hello all,
>
>I need to strip some HTML tags from a stringHowever,
> the complete tags are not consis
> -Original Message-
> From: OROSZI Balázs [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 10:07 AM
> To: [EMAIL PROTECTED]
> Subject: determining variable types
>
>
> Hello!
>
> Is it possible to get the type of a variable at run time
> (hash, array, scalar)?
> Suppose
> -Original Message-
> From: Ben Siders [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 16, 2003 7:38 AM
> To: Perl
> Subject: Escaping Ampersands in XML
>
>
> I've got a real easy one here (in theory). I have some XML
> files that
> were generated by a program, but generated im
> -Original Message-
> From: Scott, Joshua [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 17, 2003 10:12 AM
> To: [EMAIL PROTECTED]
> Subject: Splitting a variable
>
>
> I've got a CSV file which I need to process. The format is
> as follows.
>
> "Smith, John J",1/1/2002,1/15/200
> -Original Message-
> From: Liss, Mike [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 17, 2003 10:21 AM
> To: [EMAIL PROTECTED]
> Subject: determining location of character in array
>
>
> Hello,
>
> Is there an easy way to get the location of a specific instance of a
> charac
> -Original Message-
> From: Steven Jackson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 20, 2003 11:24 AM
> To: [EMAIL PROTECTED]
> Subject: Counting words in a line?
>
>
> Hi,
>
> this is my first post, so go ahead, call me a newbie.
>
> How do I count the number of words in a
> -Original Message-
> From: Pankaj Kapare [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 19, 2003 2:00 AM
> To: [EMAIL PROTECTED]
> Subject: How to use ATL COM components in perl
>
>
> Hi,
>Can anybody tell me how to use perl components in perl.
> Pankaj.
>
See the following
> -Original Message-
> From: Toby Stuart [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 20, 2003 3:26 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: How to use ATL COM components in perl
>
>
>
>
> > -Original Message-
>
> -Original Message-
> From: Michael Kingsbury [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 22, 2003 12:28 PM
> To: [EMAIL PROTECTED]
> Subject: Bareword Constant from Package giving problems with use
> strict
>
>
> How do I use a (known) Bareword constant from a package wh
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 12:29 PM
> To: '[EMAIL PROTECTED]'
> Subject: Removing HTML Tags
>
>
> Gidday all,
>
> When using our CMS (Interwoven Teamsite) I want to remove
> from any textarea any html ta
small modification below.
> -Original Message-
> From: Toby Stuart [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 12:56 PM
> To: 'Johnstone, Colin'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: Removing HTML Tags
>
>
>
>
> -Original Message-
> From: Dan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 1:19 PM
> To: [EMAIL PROTECTED]
> Subject: finding protocal script is called with
>
>
> Hello, here's one for you all.
>
> What is the fastest way to find out what protocal a script is being
> > > > -Original Message-
> > > > From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, January 23, 2003 12:29 PM
> > > > To: '[EMAIL PROTECTED]'
> > > > Subject: Removing HTML Tags
> > > >
> > > >
> > > > Gidday all,
> > > >
> > > > When using our CMS (Interwoven
> -Original Message-
> From: Dan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 2:14 PM
> To: Toby Stuart
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: finding protocal script is called with
>
>
> Below works like a charm, thanks for the i
> -Original Message-
> From: Nilesh [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 11:55 AM
> To: [EMAIL PROTECTED]
> Subject: Re: How to use ATL COM components in perl
>
>
>
> "Pankaj Kapare" <[EMAIL PROTECTED]> wrote in message
> 005901c2bf02$59dada70$a300a8c0@anurag">
> -Original Message-
> From: Southworth, Harry [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 24, 2003 10:38 PM
> To: [EMAIL PROTECTED]
> Subject: MS Word question
>
>
> I'm running Perl on Cygwin on top of Windows 2000.
>
> I have a lot of ascii text files that someone has thoughf
> -Original Message-
> From: Jamie Risk [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 30, 2003 9:32 AM
> To: [EMAIL PROTECTED]
> Subject: creating hash from name/value found in file.
>
>
> Okay, it's 5:25pm and I started programming PERL shortly
> after downloading
> the 5.8.0 t
> -Original Message-
> From: Kevin Old [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 30, 2003 12:18 PM
> To: [EMAIL PROTECTED]
> Subject: Parsing Fixed Length data
>
>
> Hello all,
>
> I have run into a situation that I've never faced before. I've always
> parsed delimited (com
> -Original Message-
> From: John W. Krahn [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 30, 2003 2:16 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Parsing Fixed Length data
>
>
> Toby Stuart wrote:
> >
> > use strict;
> > use warnings;
> > > my $i=0;
> > > while ()
> > > {
> > > @fields = unpack("A10A10A7", $_);
> >
> > my @fields = unpack 'A10A10A7', $_;
> >
> >
> > > $records{$i} = {
> >
> > Why not just use an array?
>
> different strokes for different strokes :)
Now that
> -Original Message-
> From: Jayesh Patel [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 31, 2003 8:15 AM
> To: '[EMAIL PROTECTED]'
> Subject: getopt::std problem ignoring options
>
>
> Hi all,
>
> Just wondering how some of you are handling this issue
> that I have.
> I am
> -Original Message-
> From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 12, 2003 11:21 AM
> To: [EMAIL PROTECTED]
> Subject: How to Add spaces at the end of a line
>
>
> Hi,
>I want to do some data validation...
> I hvae to read each (row)line in a file and h
> -Original Message-
> From: brady jacksan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 18, 2003 3:50 PM
> To: [EMAIL PROTECTED]
> Subject: Using alternatives and anchors
>
>
>
> I am writing a script that will read from a file named
> myfiles not stdin and print the lines co
> -Original Message-
> From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 19, 2003 1:25 PM
> To: [EMAIL PROTECTED]
> Subject: How to get 1st line, last line and no of lines in a file
>
>
> Hi,
>How to get first line, last line and no of lines in
> a file.
>
> -Original Message-
> From: David Gerler [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 24, 2003 7:22 AM
> To: Beginners
> Subject: Module to access MS Word files.
>
>
> I have search cpan for modules to access MS Word files so that I can
> parse data from the files. I haven't had
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 07, 2003 4:11 PM
> To: [EMAIL PROTECTED]
> Subject: PErl subroutine
>
>
> Gidday All,
>
> please help with my subroutine
>
> sub cleanText{
> my $cleanedText = @_;
>
my $cleanedText = s
> -Original Message-
> From: Christian Calónico [mailto:[EMAIL PROTECTED]
>
> I need to know if there is any way to handle
> Windows DLL or Activex from Perl (I'm using ActivePerl).
Check out the Win32::OLE and Win32::API modules.
> Is there any way to control serial ports?
http://se
Hi Mariusz,
Regarding your first point:
> 1. Create file called somehow so I could call it back when the person
decides to check out (their ip address?)
Don't use the IP address to differentiate between users. May users will
come via a proxy server which will report the same IP for each user.
#!perl.exe -w
use strict;
my $filename = 'image.gif';
#my $filename = 'image.jpg';
if ($filename =~ m/^.*\.(jpg|gif)$/)
{
print "Got one!";
}
---
hth
toby
-Original Message-
From: Troy May [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 03, 2002 3:58 PM
To: Perl Beginners
S
http://search.cpan.org/
Net::DNS::* ???
There might be something there that does what you need.
-Original Message-
From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 3:32 PM
To: [EMAIL PROTECTED]
Subject: Module for DNS to find MX Records ?
Hello Al
Hi Karen,
use strict;
use warnings;
use Fcntl qw(:flock);
open(F,"somefile.txt") || die $!;
flock(F,LOCK_EX);
# do stuff with F
flock(F,LOCK_UN);
close(F);
If you're on windoze, don't expect it to work with 9x.
Regards
Toby
-Original Message-
From: Karen Liew Ying Ping [mailto:[EM
use strict;
use warnings;
my @list = qw(0 1 1 1 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1);
my @out;
@out = grep($_ != 0, @list);
foreach (@out){ print $_, "\n"; }
-Original Message-
From: Michael Rauh [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 05, 2002 4:40 PM
To: Beginners, Perl
Subject: p
Hi Patricia,
Whilst this does not answer your question in full it should act as a
starting point.
@array = qw(1 2 3 4); # four elements
print $#array+1; # will print 4
HTH
Toby
"Patricia Hinman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does anyone kn
change:
seek(LOG,0,2);
to:
seek(LOG,-1,2);
hth
toby
-Original Message-
From: William Black [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 10:42 AM
To: [EMAIL PROTECTED]
Subject: RE: seek function call
Hi all,
I have a quick question about seek(). If I ha
Sorry my bad, this doesn't work with lines as Andy Lester pointed out.
When i tested it i had a file with one char on each line. My apologies :(
Toby
-Original Message-
From: Toby Stuart [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 11:04 AM
To: '[EMAIL PROT
Funny. This simple test works for me:
use strict;
use warnings;
my $t = &fun;
print @$t[0]; # prints a
sub fun
{
my @arr = qw(a b c d e);
return \@arr;
}
hth
Toby
-Original Message-
From: Zachary Buckholz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 4
$line = substr($line,0,19,) . "...";
> -Original Message-
> From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 18, 2002 11:52 PM
> To: [EMAIL PROTECTED]
> Subject: Chopping a string.
>
>
> Hi all,
>
> I have a string $line that can be a short word or a very long
> -Original Message-
> From: Toby Stuart [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 19, 2002 4:46 PM
> To: 'Octavian Rasnita'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: Chopping a string.
>
>
> $line = substr($line,0,19,) . "...&
read the "Regexp Quote-Like Operators" section of the perlop manpage
> -Original Message-
> From: Rum Pel [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 17, 2002 2:48 PM
> To: [EMAIL PROTECTED]
> Subject: qq/qw
>
>
> hello
>
> perl -e "print qq(@INC)"
> prints the library paths
$ua->request returns a HTTP::Response object.
$res is probably better written as $response.
the 'if ($res->is_success)' line is testing whether the $request succeeded
or threw some HTTP error.
hth
toby
> -Original Message-
> From: Rum Pel [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, Se
have a look at the Tk::Table module.
i have provided a trivial example below.
#--- 8< ---#
use strict;
use warnings;
use Tk;
use Tk::Table;
my $mw;
my $table;
my $txtEntry1;
my $txtEntry2;
$mw = new MainWindow();
$mw->title("Table Layout
$a = 1;
@b = (1,2,3,4);
$i = grep(/$a/,@b);
print "in array" if $i > 0;
> -Original Message-
> From: Alex Cheung Tin Ka [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 26, 2002 5:00 PM
> To: [EMAIL PROTECTED]
> Subject: how to check variable in list
>
>
> Dear All,
> I woul
> -Original Message-
> From: Javeed SAR [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 5:05 PM
> To: [EMAIL PROTECTED]
> Subject: spaces in a variable
>
>
> Hi,
>
> How to remove spaces in a variable?
> For eg if i have variable $te
>
> $te = $attr_tag . $date;
> cho
given that you are passing a file path you could use File::Basename
eg.
use strict;
use File::Basename;
my $file =
'M:\jav_test\Technical_Docs\.@@\main\int_1_2b\techdoc_1_2b\2\Common_Controls
\main\int_1_2b\techdoc_1_2b\1\Code_Examples\main\int_1_2b\techdoc_1_2b\2\Ext
ernalID\main\int_1_2b\te
If i understand what u want, the following works (i'll leave the printing to
another file up to you)
use strict;
use warnings;
my %totals;
my $date;
my $count;
while ()
{
chomp($_);
($date,$count) = split(/,/,$_);
$totals{$date} += $count;
}
while (($date,$count) = ea
> -Original Message-
> From: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 11, 2002 3:58 PM
> To: Perl beginners
> Subject: RE: excluding @@
>
>
> On Thu, 10 Oct 2002, david wrote:
>
> > Sudarshan Raghavan wrote:
> >
> > >
> > > You will have to escape the @
$str = " a_ string ";
$str =~ s/\s+//g;
print $str;
btw. chomp() removes the character defined by $/ (newline unless you change
it) from the end of a string.
chop() removes the last character from a string.
> -Original Message-
> From: learn perl [mailto:[EMAIL PROTECTED]]
> Sent:
my $file = "a_binary_file.exe";
# my $file = "a_text_file.txt";
if (-B $file) # -B is opposite of -T (text)
{
print "$file is binary\n";
}
else
{
print "$file is NOT binary\n";
}
> -Original Message-
> From: George P. [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, Octobe
not sure you can in ascii
a couple of brackets will do the trick
(c)
in HTML you can use ©
> -Original Message-
> From: Johnstone, Colin [mailto:Colin.Johnstone@;det.nsw.edu.au]
> Sent: Friday, October 18, 2002 12:32 PM
> To: '[EMAIL PROTECTED]'
> Subject: copywrite symbol
>
been a long time since i done any SQL but i *think* you have to quote
single-quotes inside a string eg.
$article = "8852001100010";
$barcode = "8852001100010";
$description = "BRAND'''S Essence of Chicken 42 cc.";
$strSQL = "INSERT INTO Product_Lookup_Table
(PL_Barcode,PL_Article,PL_Desc
see correction below
> -Original Message-
> From: Toby Stuart
> Sent: Friday, October 18, 2002 11:31 AM
> To: 'Andrew Hubbard'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: Single Quote marks in a string
>
>
> been a long time since i done an
http://www.vim.org
> -Original Message-
> From: Mariusz [mailto:mkubis22@;hotmail.com]
> Sent: Wednesday, October 23, 2002 9:58 AM
> To: perl
> Subject: good text editor
>
>
> Can someone recommend a good text editor for perl cgi
> scripting? I've been using notepad, but was wondering
Hi All,
I'm trying to encrypt/decrypt a text file using Crypt::CBC with DES.
The encryption works fine but the decryption seems to yield
only the first
few bytes of the original text. I'm sure i'm missing
something simple.
Any help appreciated.
Example follows:
use strict;
thanks that did it.
i always forget to binmode things :(
cheers
toby
> -Original Message-
> From: John W. Krahn [mailto:krahnj@;acm.org]
> Sent: Wednesday, October 23, 2002 4:26 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Crypt::CBC w/Crypt-DES
>
>
> Toby Stuart
i'm confused. i don't have XP and cannot see how this can work. is GET a
shell function or am i missing something simple here? that said, if you are
trying to get stuff off the web best to use the LWP modules, say LWP::Simple
eg.
use strict;
use warnings;
use LWP::Simple;
getprint("http://www
use strict;
use Cwd;
$dir = cwd;
print $dir;
> -Original Message-
> From: Johnstone, Colin [mailto:Colin.Johnstone@;det.nsw.edu.au]
> Sent: Thursday, October 31, 2002 11:20 AM
> To: '[EMAIL PROTECTED]'
> Subject: Current Directory Name
>
>
> Gidday All,
>
> How do I find out the name
> -Original Message-
> From: Mark Weisman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 02, 2003 4:53 PM
> To: [EMAIL PROTECTED]
> Subject: Reverse Order?
>
>
> I read a text file into HTML for viewing through a webpage, fairly
> straight forward.
>
> Open (INFILE, " filename.tx
> -Original Message-
> From: Nigel Peck - MIS Web Design [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 04, 2003 10:26 AM
> To: [EMAIL PROTECTED]
> Subject: IIS Log File Conversion
>
>
> Does anyone have a code snippet or a module for converting
> the IIS log file format to NCSA
> -Original Message-
> From: David Wall [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 05, 2003 12:03 PM
> To: [EMAIL PROTECTED]
> Subject: RE: IIS Log File Conversion
>
>
>
>
> --On Thursday, September 04, 2003 9:48 AM +0100 Nigel Peck -
> MIS Web Design
> <[EMAIL PROTECTED]>
92 matches
Mail list logo