I am sending the email to the [EMAIL PROTECTED] and I am sending to you
also as this is urgent. Using your previous help I can able to solve my
problems.
sorry.
I am having following code and this prints the report in following format
sender: xyz.abc
department: xxx
branch: yyy
---
[EMAIL PROTECTED] wrote:
> > my $return = do_wrap('hello');
>
> Doesn't this have to be MyCommon::do_wrap('hello'); ?
No. You do not have to prepend the package name when Exporter is properly
invoked. That proper invocation can be a bit tricky, though. That is why it
sat for a few days, while
On Tue, 07 Oct 2003 12:56:50 -0400, Li, William wrote:
> Silly question, is there an equal but opposite function to chop in Perl?
No.
> I'd like to remove the first and last character of a string and am looking
> for a simple way to do it.
The most elegant way to do it, IMO, is to use a regular
Rob Hanson wrote:
> You could just use a regex...
>
> $string =~ s/.//;
>
> Or even substr()...
>
> substr($string, 0, 1, '');
>
> Both look equally efficient.
except they are different and they don't work the same way:
[panda]$ perl -le '$_="\n1234"; s/.//; print'
234
[panda]$ perl -le '$_
Rob Hanson wrote:
>> $string =~ s/^.(.*).$/$1/;
>
> It's prettier, but it's very inefficient. It's probably 20+ times slower
> then doing it in two steps.
>
> It has to do with how Perl internally handled string data. When you s///
> or substr() all it does is move a pointer.
>
this is an
> my $return = do_wrap('hello');
Doesn't this have to be MyCommon::do_wrap('hello'); ?
When running it, the error: Undefined subroutine &main::do_wrap
thanks,
-rkl
> [EMAIL PROTECTED] wrote:
>
>> How can I reuse a subroutine?
>>
>> My environment is redhat 9, apache2, perl-5.8.0-88, mod_perl-1.
In article <[EMAIL PROTECTED]>,
Stephen Hardisty wrote:
> Afternoon,
> you could use Term::ReadKey, for example:
>
> use Term::ReadKey;
>
> # if you hit ctrl-c you still want to return to 'normal'
> $SIG{INT} = sub{ReadMode('normal')};
>
> ReadMode('cbreak');
>
> # 'ord' returns the ASCII valu
1 - What is the best char to use in a file template?
Also, please give me a good regex?
I will have a formatted html page with some keys that I want to replace.
For example,
...
First Name:!fname!
Last Name:~!lname!
...
2 - Can I read in the whole page and do a replacement?
I'm thinking it
> $string =~ s/^.(.*).$/$1/;
It's prettier, but it's very inefficient. It's probably 20+ times slower
then doing it in two steps.
It has to do with how Perl internally handled string data. When you s/// or
substr() all it does is move a pointer. With your version it would need to
rewrite the w
On Tuesday, October 7, 2003, at 11:56 AM, Li, William wrote:
Hi,
Howdy.
Silly question, is there an equal but opposite function to chop in
Perl?
I'd like to remove the first and last character of a string and am
looking
for a simple way to do it. So far I have:
# "1234567" -> "23456"
chop($s
You could just use a regex...
$string =~ s/.//;
Or even substr()...
substr($string, 0, 1, '');
Both look equally efficient.
Rob
-Original Message-
From: Li, William [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:57 PM
To: [EMAIL PROTECTED]
Subject: Chopping off first&la
On Mon, Oct 06, 2003 at 07:52:31PM -0500, Wiggins d'Anconia wrote:
> Richard Fernandez wrote:
> > On Fri, Oct 03, 2003 at 09:24:01PM -0400, TN wrote:
> >
> >>Based on your delete criteria, it would be much easier to filter out
> >>unwanted mail messages on an incoming relay mailer in your DMZ. Yo
Hi,
Silly question, is there an equal but opposite function to chop in Perl?
I'd like to remove the first and last character of a string and am looking
for a simple way to do it. So far I have:
# "1234567" -> "23456"
chop($string); # "123456"
$string = reverse($string); # "654321"
chop($string);
"John W. Krahn" wrote:
>
> Kevin Old wrote:
> >
> > I have been using Visual Regexp
> > http://freshmeat.net/projects/visualregexp
> >
> > But have recently stumbled upon RegExplorer which has a cleaner
> > interface.
> > http://regexplorer.sourceforge.net
>
> Another one - regexEvaluater:
>
> h
On Tue, 7 Oct 2003 16:09:44 -0400 , Roberts Mr Richard L <[EMAIL PROTECTED]> wrote:
> Sorry, new to discussion group
> yet thanks for the advice.
Also remember to group reply so others can help and be helped.
>
> to the remote?> is what I am at
Kevin Old wrote:
>
> Hello everyone,
Hello,
> I've seen several postings over the past few weeks about Regular
> Expressions and just thought I'd share a couple of tools that I use when
> building regular expressions.
>
> I have been using Visual Regexp
> http://freshmeat.net/projects/visualreg
Wiggins D'Anconia wrote:
>
> Dan Anderson wrote:
>
> > I have a module that works with a couple of different file handles. Is
> > it possible to hide them within an anonymous hash? {} (i.e. the objects
> > data). Right now I have:
> >
> > if (condition_is_met()) {
> > open("FILE"," > }
> >
> >
I have full permissions as earlier code creates new dir: $site, yet when I
try to 'cd' or even 'cwd' notta thus when I try to cp $ssh->cmd("cp $file
20020922"); it bombs.
-Original Message-
From: TN [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 1:10 PM
To: 'Roberts Mr Richard L
On Tue, 7 Oct 2003 15:43:00 -0400 , Roberts Mr Richard L <[EMAIL PROTECTED]> wrote:
> I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when I
> try to pass a local file to remote host to copy file to newly created
> directory, it
I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when I
try to pass a local file to remote host to copy file to newly created
directory, it fails:
code:
use Net::SSH::Perl
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
print $ssh->cmd("mkdir $site);
print $ss
Dan Anderson wrote:
> I have a module that works with a couple of different file handles. Is
> it possible to hide them within an anonymous hash? {} (i.e. the objects
> data). Right now I have:
>
> if (condition_is_met()) {
> open("FILE"," }
>
> This is in the main body of my package (and thus
On Tue, 07 Oct 2003 15:22:34 -0400, Dan Anderson <[EMAIL PROTECTED]> wrote:
> I have a module that works with a couple of different file handles. Is
> it possible to hide them within an anonymous hash? {} (i.e. the objects
> data). Right now I h
John wrote:
>
> Rob Dixon wrote:
> >
> > John wrote:
> > >
> > > I want to create a doc file that will contain my text,
> > > fonts, sizes as if i wrote manually.
> >
> > You can use Win32::OLE drive MSWord itself to generate a document,
> > but I think that's an awful way to do things. Why not loo
I have a module that works with a couple of different file handles. Is
it possible to hide them within an anonymous hash? {} (i.e. the objects
data). Right now I have:
if (condition_is_met()) {
open("FILE","
On Mon, 06 Oct 2003 14:20:05 -0400, Chris Charley wrote:
> Then, on the command line I type: perl prepend.pl somefile.txt, but
> somefile.txt does not have the changes(Line: ).
Try writing 'perl prepend.pl somefile.txt > newfile.txt' instead.
--
Tore Aursand <[EMAIL PROTECTED]>
--
To unsubsc
the code:
$ssh->cmd("mkdir $direct");
functions as directory '$direct' is created,
yet my next line of code:
$ssh->cmd("cd $direct"); chokes as I run next line to confirm:
$ssh->cmd("pwd"); shows no directory change, still in parent directory
thus when I run:
$ssh->cmd("cp $file1 $file2");
gets
Is the $site directory actually created? What are it's permissions?
Maybe you can
$ssh->cmd("cp $site/$filename");
But I thought cp required at least two args.
-tristram
-Original Message-
From: Roberts Mr Richard L [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:48 PM
Well, in that case, should i open the HTML fileas a filehandler an resave it
as a word doc by using the Win32::OLE module?
- Original Message -
From: "Stout, Joel R" <[EMAIL PROTECTED]>
To: "'John'" <[EMAIL PROTECTED]>; "Perl Beginners" <[EMAIL PROTECTED]>
Sent: Tuesday, October 07, 2003
Dan Muey wrote:
>
> [EMAIL PROTECTED] wrote:
> >
> > I'm trying to validate if a string contains \w and required
> atleas one
> > period (.)
>
> By \w do you mean just whitespace or '\\w'?
Isn't \w a-zA-Z0-9_ ??
And whitespace \s ??
Yes. Getting muddled up for some reason - thanks Dan.
At least
>:) The problem is that i want to use Fonts and Different Sizes, bold,italic
>in my text. Not just a simple text.
Rob's answer may be better for you but remember - HTML can handle your
fonts, sizes, yada, yada. Google "CSS".
Using perl, write the text below to a file, name it test2.doc and the
"Rob Dixon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> John wrote:
> >
> > I want to create a doc file that will contain my text,
> > fonts, sizes as if i wrote manually.
>
> You can use Win32::OLE drive MSWord itself to generate a document,
> but I think that's an awful way to
I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when I
try to pass a local file to remote host to copy file to newly created
directory, it fails:
code:
use Net::SSH::Perl
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
print $ssh->cmd("mkdir $site);
print $ss
> Thanks, you did good with this code for me. I did not want to
> load more library as most suggested. This works just fine
Why not? One simple use statement and you're done. Platform independent,
No relying on an external program to be at the path you specify, use the switches you
specify,
Or
Tn wrote:
> Suggest you install and use cygwin including its perl package. It
> includes Term::Readkey and the other core packages. I just did a cygwin
> installation on win2k yesterday and it went smoothly. Note that emacs
> and midnight commander are the only default editors, but nano and vim
> -Original Message-
> From: Rob Dixon [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 03, 2003 4:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Validate String w/required period
>
>
> [EMAIL PROTECTED] wrote:
> >
> > I'm trying to validate if a string contains \w and required
> atlea
On Tue, 2003-10-07 at 11:42, Aman Raheja wrote:
> The M$ Word .doc creation has just been answered. What about excel - .xls ?
>
> I have done comma and tab seperated .csv files which is just writing a normal text
> file and open in Excel but some versions mess it up and show all the comma seperat
Have you got the code to test if you concept is what i need?
- Original Message -
From: "Stout, Joel R" <[EMAIL PROTECTED]>
To: "'John'" <[EMAIL PROTECTED]>; "Perl Beginners" <[EMAIL PROTECTED]>
Sent: Tuesday, October 07, 2003 6:32 PM
Subject: RE: Microsoft Word Creation
> Good place to
On Tuesday, October 7, 2003, at 10:42 AM, Aman Raheja wrote:
The M$ Word .doc creation has just been answered. What about excel -
.xls ?
Spreadsheet::WriteExcel is available from the CPAN.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Spreadsheet::WriteExcel
You can also play with the OLE module if you on a windows only machine.
Spreadsheet::Writeexcel works on anything. I use it on our sco and Linux
boxes.
-Original Message-
From: Aman Raheja [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 11:43 AM
To: [EM
The M$ Word .doc creation has just been answered. What about excel - .xls ?
I have done comma and tab seperated .csv files which is just writing a normal text
file and open in Excel but some versions mess it up and show all the comma seperated
fields in one.
Suggestions appreciated!
Thanks
Am
John wrote:
>
> I want to create a doc file that will contain my text,
> fonts, sizes as if i wrote manually.
You can use Win32::OLE drive MSWord itself to generate a document,
but I think that's an awful way to do things. Why not look at
RTF::Generator which will let you create an RTF file which
Good place to ask. Jenda and some others are great with perl and M$. One
thing I've done in the past is to write HTML but save it as a *.doc.
Example:
Open a file and write:
testtest test test
Save it as test.doc.
Open it in Word. It show the formatting. The user can then edit and save
as a
Hi Trina.
Trina Espinoza wrote:
> I have a file that I want to run multiple actions on. First, the file is
> read in as one long string. I want to
> substitute some words with others so I run a substitution. That seems to
> change the data in the first
> while, HOWEVER, when I run the second while
I want to create a doc file that will contain my text, fonts, sizes as if i wrote
manually.
Can i do that thing?
Jerry Preston wrote:
>
[snip]
>
> s/(?=[A-z|0-9]+)\*(?=[A-z]+)/' * '/g;
It's also worth noting that /[A-z]/ isn't what you think
it is. Look:
use strict;
use warnings;
for (map chr, 0x00 .. 0x7F) {
print if /[A-z]/;
}
OUTPUT
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu
On Oct 7, Jerry Preston said:
> s/(?=[A-z|0-9]+)\*(?=[A-z]+)/' * '/g;
You want to change "3*foo" to "3 * foo", right? Well then, there are a
couple problems with your regex.
First, the (?=...) at the beginning is a look-AHEAD. You want a
look-BEHIND, and you only need to look behind for one c
Jerry Preston wrote:
>
> I am trying to change some text from:
>
> if ( (fabs(log(im[ii]/im[ii-1])/vstep) >
> fabs(3*log(im[ii-1]/im[ii-5])/(4*vstep)) ) && ((im[ii] > ifr[x]) ||
> (im[ii-1] > ifr[x])) ) {
> to
> if ( (fabs(log(im[ii]/im[ii-1])/vstep) > fabs(3 *
> log(im[ii-1]/im[ii-5])/
Saikatranjan Parida wrote:
>
> I am trying to embed perl in my C++ program. My application needs to
> evaluate different very simple perl programs. These perl programs will be
> created on the fly. So they can't be in any file on the disk. I read up
> perlembed and tried to execute the statements u
Suggest you install and use cygwin including its perl package. It
includes Term::Readkey and the other core packages. I just did a cygwin
installation on win2k yesterday and it went smoothly. Note that emacs
and midnight commander are the only default editors, but nano and vim
are selectable as
Hello everyone,
I've seen several postings over the past few weeks about Regular
Expressions and just thought I'd share a couple of tools that I use when
building regular expressions.
I have been using Visual Regexp
http://freshmeat.net/projects/visualregexp
But have recently stumbled upon RegEx
In article
<[EMAIL PROTECTED]>,
Nyimi Jose wrote:
> If you are tired typing "my $self = shift;"
> There are modules out there that can build class for you.
> http://search.cpan.org/search?query=Class%3A%3AStruct&mode=module
>
> I'm using Class::Struct module coming with perl.
It's probably good
Again, you MUST send these to the Perl Beginner's List, if you want
answers.
On Monday, October 6, 2003, at 10:48 PM, vaishali wrote:
thanks my problem is solved
I am having another query.
I am having mysql and the table is sms_log. In that my sender field
format is
xyz abc <[EMAIL PROTECTED]
Hi,
Jerry Preston <[EMAIL PROTECTED]> asked:
> I am trying to change some text from:
>
> if ( (fabs(log(im[ii]/im[ii-1])/vstep) >
> fabs(3*log(im[ii-1]/im[ii-5])/(4*vstep)) ) && ((im[ii] > ifr[x]) ||
> (im[ii-1] > ifr[x])) ) {
> to
> if ( (fabs(log(im[ii]/im[ii-1])/vstep) > fabs(3 *
>
Hi!
I am trying to change some text from:
if ( (fabs(log(im[ii]/im[ii-1])/vstep) >
fabs(3*log(im[ii-1]/im[ii-5])/(4*vstep)) ) && ((im[ii] > ifr[x]) ||
(im[ii-1] > ifr[x])) ) {
to
if ( (fabs(log(im[ii]/im[ii-1])/vstep) > fabs(3 *
log(im[ii-1]/im[ii-5])/(4 * vstep)) ) && ((im[ii] > ifr
Hi,
Chris Charley <[EMAIL PROTECTED]> wrote:
> Should be (works correctly):
>
> while (<>) {
>s/^/Line: $. /;
>print;
> }
>
> Then the command could be:perl prepend.pl somefile.txt >
> somefile.new
> which would correctly print to the 'new' file the
> somefile.txt file wi
Chris Charley wrote:
> "Chris Charley" <[EMAIL PROTECTED]> wrote in message news:...
> [snip]
> > while (<>) {
> > s/^/Line: $. /;
> > }
>
> Should be (works correctly):
>
> while (<>) {
>s/^/Line: $. /;
You don't need a regular expression to do this. This should suffice
$_ = "Line
John W. Krahn wrote:
> perldoc -q password
>
> Found in /usr/lib/perl5/5.6.0/pod/perlfaq8.pod
>How do I ask the user for a password?
>
>(This question has nothing to do with the web. See a
>different FAQ for that.)
>
>There's an example of this in the crypt entry
You're reading in the file, but not changing it. You're only changing it in
memory. Check out the responses to the other post called "make changes to a
file, then reading in those changes"
-Original Message-
From: Chris Charley [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 1
"Chris Charley" <[EMAIL PROTECTED]> wrote in message news:...
[snip]
> while (<>) {
> s/^/Line: $. /;
> }
Should be (works correctly):
while (<>) {
s/^/Line: $. /;
print;
}
Then the command could be:perl prepend.pl somefile.txt > somefile.new
which would correctly prin
Hi
Hope someone can help with this. I used to be able to do it, but now have
forgotten. I want to prepend some text to every line in a file. The program
below:
#!/usr/bin/perl
# prepend.pl - adds line number to beginning of every line in a file
use strict;
use warnings;
while (<>) {
s/^/Li
Hello,
I am trying to embed perl in my C++ program. My application needs to
evaluate different very simple perl programs. These perl programs will be
created on the fly. So they can't be in any file on the disk. I read up
perlembed and tried to execute the statements using eval_pv. This evaluation
Trina Espinoza wrote:
> I have a file that I want to run multiple actions on. First, the file is
> read in as one long string. I want to
> substitute some words with others so I run a substitution. That seems to
> change the data in the first
> while, HOWEVER, when I run the second while loop on t
62 matches
Mail list logo