Howdy,
I'm trying to run the AppConfig module, but making a error somewhere, it
should be straight forward but
At any rate here is the code, followed by the config file followed by
the error.
#code
#!/usr/bin/perl
use AppConfig;
my $file = "/var/tmp/config.txt";
my $config = AppConfig->ne
http://www.perldoc.com/perl5.6.1/lib/DBI.html
-Original Message-
From: Jefferson Ryan Lee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 8:52 PM
To: [EMAIL PROTECTED]
Subject: perl database access
Hi,
Are there any way to access a database (SQL Server) not using th
> using the Perl4 cgi-lib.pl. However, I can think of no other
> legitimate use. Here's a nice,
> clean method of dealing with this:
>
> use strict;
> use CGI qw/:standard/;
> my %form_data = map { $_, get_data($_) } param;
>
> sub get_data
> {
> my $name = shift;
>
eep! I am referring to the system() call there... :)
-- Forwarded message --
Date: Fri, 1 Feb 2002 09:09:50 +0530 (IST)
From: Deen Hameed <[EMAIL PROTECTED]>
To: Russell Boyd <[EMAIL PROTECTED]>
Cc: "<" <[EMAIL PROTECTED]>
Subject: Re: pulling file name into perl
Hi Russell,
I
Hi Russell,
It executes a command and returns the EXIT STATUS of the command.
If you look in $date, you will find the exit status of "ls ..." as
returned by the wait() call.
deen
On Thu, 31 Jan 2002, Russell Boyd wrote:
> I am wanting to get a unix directory file listing and put it into a P
That was uneventful.
-Original Message-
From: Eric [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 9:49 PM
To: [EMAIL PROTECTED]
Subject: test
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Try setting the background image in a frame with the background
attribute of the HTML body tag:
Your content here
Where you change "myImage.jpg" to whatever your image is named.
You can insert the animated gif through the tag.
hth,
Maureen
Luinrandir Hernson wrote:
>
> Sorry if this is
..
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Sorry if this is off topic, but I really don't know who else to ask.
Heres what I want to do.. maybe you would be so kind as to tell me what language this
can best be done in. I'm just learning perl and know HTML.
within frames (or a table)...
I would like to put a large gif in the backround an
Hi,
Are there any way to access a database (SQL Server) not using the ODBC?
It is possible for a perl script to query a database not on a local
machine instead on a different location through tcp-ip/internet? Please
advise. Thanks.
Regards,
Jeff
--
To unsubscribe, e-mail: [EMAIL
Hello All,
Here is the code for the format command:
use Win32::Service;
push( @ARGV, Win32::NodeName() ) unless( scalar @ARGV );
foreach my $Machine ( @ARGV )
{
local %List;
print "Available services on $Machine:\n";
if( Win32::Service::GetServices( $Machine, \%List ) )
{
From windows, but just using std Perl functions:
use Time::Local;
my $MyKnownDate = timelocal(0,0,17,18,0,102);
printf "%-s\n", scalar(localtime($MyKnownDate));# just reprinting so you know
we are using the
subject fairly sums it up. If I use localtime to get what time it is right
now how can I determine the number of minutes between a KNOWN moment, such
as above, and say, at the time the script is run? So far I have nothing
and am perplexed...
_
http://quanti
> The only problem is that WEB server has been configured to allows access to
> this
> site based on a range of IP address. If a new organization subscribes to
> this site
> (flat fee, unlimited access only), their IP range is made known to the web
> server (the Sys Admin's job).
>
> So my initia
Any one have some GOOD (maybe GREAT) documentation or links for Win32 GUI?
Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I apologize for the multiple posts. The post with attachments was
"rejected" once by the list with "Your mail to murzc could not be delivered
because murzc is not accepting mail with attachments or embedded images" so
I sent it a second time with the code snippets included in the post. Don't
kno
Title: Blank
use somehting
like:
my ($mday, $mon, $year) =
(localtime(time))[3..5];
# pull day,month, year
only$year += 1900; #
want 4 digit date$mon++; #
need
I'm looking for a way to grab just the IP address from an ifconfig command
then send that variable out to an email address via a sendmail process.
Does anyone have any ideas how to write this little script?
Thanks,
Richard
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
Title: Blank
Ok, so I'm confused
What I want to do is create a directory
where the name is the current date say
mkdir(2002131);
What Can't figure out is how to build the
date string. I'm sure I'm just missing something.
Any thoughts.
-regards
-mark
- Mark Richmond <[EMAIL PR
William,
It sounds like you've found a solution that you like in querying ARIN; what
are you asking for help with?
Jacob
On Thu, 31 Jan 2002 [EMAIL PROTECTED] wrote:
> Hello,
>
> Is there a better way to solve this?
>
>
> PROBLEM:
>
> I have set up a web site for a government big contractor, i
Thanks. Works great. Any ideas how I might sort the output hash for output
to a file in key order?
-Original Message-
From: Roger C Haslock [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 2:23 PM
To: Balint, Jess; [EMAIL PROTECTED]
Subject: Re: More Economic Use of Hash
# Wh
I have pasted my code below. The problem I am having is:
my $ndate = join('-', $nyear,$nmonth,$nday);
is printing back to my form the exact format that should be correct to
insert into mysql. However, when the INSERT runs the value does not get
inserted properly. $nyear,$nmonth,$nday are grab
Well, my boss wants to find out if there is a BETTER solution.
I do not want to say NO right away, so I figured why not as
around? He might be right. There may be an alternative
solution.
Personally, I wish there is not. Because I have had it with
this project.
__
William Am
On Jan 31, Nikola Janceski said:
>you want to treat $text as a single string
>use
>$text =~ s/\n+/\n/sg; # use /mg if you want to treat the string as multiple
>lines.
Your information about /s and /m is wrong. /s changes how . matches, and
there is no . in your regex. /m changes how ^ and $ w
In NT you can use the start command with a URL. So to start a brower
at a specific location:
system( "start http://jpw3.com/search.html"; );
Depending on how you have IE configured, this might start a new window.
If it doesn't and you need to use a new browser window:
system( "start iexplor
better...(assuming the filename would never have a stupid / in it)
($drive, $path, $file) = ($fullpath =~ m~(\w:)/(.*?)([^/]+)$~);
would output:
C:
TopDir/outer/inner/
file.fl
-Original Message-
From: Curtis Poe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 3:39 PM
To: [
--- [EMAIL PROTECTED] wrote:
> I know this is not a good RegEx. Can I see some criticism and fine-tuning of
> this RegEx that I came up with?
>
> Objective: To parse the path to drive, directory and file name.
>
> Here is what I came up with.
>
> #
> $fullpath =
Hi,
My oversight, I forgot to say that this would be on my own local machine a
Win 2k box
Since I am sometimes in a text editor that has ability to launch a perl
file then: the handyness to get a url launched by using a perl script to do so
Thanks. Alan.
At 06:41 AM 1/31/2002 -0800, you wro
> >Fields are all unique.
>
> Fields are not all unique.
>
>Chocolate
>Vanilla
>Strawberry
I'm sorry Jeff, I meant that in this case, with this script and set of web
pages, the fields are all unique.
For real new beginners, note also another relatively common way that field
names can
Use backticks, not system().
$date = `ls -al | grep filename.txt`;
Or if you want it in an array like you mentioned, do this...
@date = `ls -al | grep filename.txt`;
Rob
-Original Message-
From: Russell Boyd [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 3:17 PM
To: <
Su
Couldn't it be:
m#^([^\\/]+)(.*)([^\\/]+)$# )
At Thursday, 31 January 2002, [EMAIL PROTECTED] wrote:
>I know this is not a good RegEx. Can I see some criticism and fine-
tuning of
>this RegEx that I came up with?
>
>Objective: To parse the path to drive, directory and file name.
>
>Here is wha
I am wanting to get a unix directory file listing and put it into a Perl array. I
attempted
$date = system "ls -al | grep filename.txt";
However all this did was send it to .
What am I missing?
Thanks,
Russell
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EM
I know this is not a good RegEx. Can I see some criticism and fine-tuning of
this RegEx that I came up with?
Objective: To parse the path to drive, directory and file name.
Here is what I came up with.
#
$fullpath = "C:/TopDir/outer/inner/file.fl";
($drive, $pat
Hello,
Is there a better way to solve this?
PROBLEM:
I have set up a web site for a government big contractor, it currently
works fine.
The only problem is that WEB server has been configured to allows access to
this
site based on a range of IP address. If a new organization subscribes to
th
Hewlett Pickens wrote:
>
> Using O'Reilly's "Learning Perl", have set up a "bare bones" socket
> connection between two computers to send a small amount of data from the
> "client" to the "server". (For learning, not for the real world.)
>
> The client sends "are you there" and the server res
Hew,
I've never delved into this area at all, but looking at your code, shouldn't
you have
Proto=> "tcp",
in the IO:::Socket... on server as well as client?
Joe
-Original Message-
From: Hewlett Pickens [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 12:50 PM
To: [EMAIL
# Why not ...
while( )
{
@tmp = split( /\|/ );
if (exists $freq{$tmp[$table]})
{
$freq{$tmp[$table]}++
}
else
{
$freq{$tmp[$table]}=1
}
$tot ++
}
- Original Message -
From: "Balint, Jess" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Th
Using O'Reilly's "Learning Perl", have set up a "bare bones" socket
connection between two computers to send a small amount of data from the
"client" to the "server". (For learning, not for the real world.)
The client sends "are you there" and the server responds with "I am here,
what do you wan
Using O'Reilly's "Learning Perl", have set up a "bare bones" socket
connection between two computers to send a small amount of data from the
"client" to the "server". (For learning, not for the real world.)
The client sends "are you there" and the server responds with "I am here,
what do you wan
Download the Win32::AdminMisc module from http://www.roth.net/perl. The
SetEnvVar() function will do what you want. Keep in mind that while new
windows will have the new environment variables, the environment the script
is running uner will still have to be set manually using the %ENV hash or
t
At 11:55 AM 1/31/02 -0500, Dave Benware wrote:
> > Nope. It just thinks that the name of the command you're running is "dir
> > foo.txt". Separate the arguments explicitly, e.g.,:
> >
> > C:\WINDOWS>perl -e "system qw(dir mouse.txt)"
>
>Yah, that works fine, tho I don't understand why. Is there
I am attemping to create a frequency chart based on a pipe delimited
database output. Following is what I have come up with. The hash create from
this is then output to another file. It seems to be very slow on files in
excess of ~1 lines. This will be used on ~50 line files and needs to
b
Using O'Reilly's "Learning Perl", have set up a "bare bones" socket
connection between two computers to send a small amount of data from the
"client" to the "server". (For learning, not for the real world.)
The client sends "are you there" and the server responds with "I am here,
what do you wan
It is neither possible in unix.
When you run a batch script under Win32, or 'source' a shell script under
unix, you only have 1 process, and that process is executing commands,
which set _its_ env variables.
If your fork a child process (ie. start perl to execute the perl-script),
it can only ch
I am trying to access a folder, but this folder is linking rapidly, I need your help.
Can anybady explain me why does ithappens.
--- "Moore, Larry" <[EMAIL PROTECTED]> wrote:
> I want to slurp a file and make multiple blank lines into single blank
> lines. Here is my code:
>
> #! perl -w
> use strict;
>
> my $file = "test.fmt";
>
> open (IN, $file) or die;
> open (OUT, ">>test.txt");
>
> my $text;
>
> {
> local
For others who may want to see how module works...
Here is a snippet of code I used with the Write:Excel module... Was
written and run on WinNT without Excel installed on the box. It reads
in csv files into Excel file and then sets some limited formatting
(freeze panes and set column widths).
I thought it would be a good idea to replace a batch script
(.bat) running on a Windows 2000 with a Perl script which
is far more clever.
The original batch file setted two environment variables
which were available after running the script. That is,
if I did
c:> cvs-init.bat
it has commands l
is this scary or what? LOL :)
On Thu, 31 Jan 2002, Deen Hameed wrote:
>
> the ? is a special character within a regular expression (which is what
> the two /s inside split contain). If you want to split on the ?, you'll
> have to escape it, like \?
>
> Have a look at perldoc perlre for what re
you want to treat $text as a single string
use
$text =~ s/\n+/\n/sg; # use /mg if you want to treat the string as multiple
lines.
-Original Message-
From: Moore, Larry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 12:33 PM
To: beginners@perl. org (E-mail)
Subject: replacing
I want to slurp a file and make multiple blank lines into single blank
lines. Here is my code:
#! perl -w
use strict;
my $file = "test.fmt";
open (IN, $file) or die;
open (OUT, ">>test.txt");
my $text;
{
local $/;
$text = ;
close IN;
}
# $text =~ s/\0{2,}/\0\0/mg; # this removes
Thank you all for you prompt and accurate help. I will not soon forget the
difference between assigning a value and a numeric comparison operator.
Jason, with the "@a=$number" statement, I was trying to create the list by
changing contexts. In other words, if returns the input in a scaler
cont
the ? is a special character within a regular expression (which is what
the two /s inside split contain). If you want to split on the ?, you'll
have to escape it, like \?
Have a look at perldoc perlre for what regular expressions are about.
deen
On Thu, 31 Jan 2002, Darren Simpson wrote:
> hi
I have used Spreadsheet::WriteExcel and it works without a hitch for me,
though I just do barebones cell creation on a single worksheet, nothing
fancy at all. Still, no one has complained at all about the end result not
being usable.
-Original Message-
From: Timothy Johnson [mailto:[EM
Peter Scott wrote:
>
> At 11:35 AM 1/31/02 -0500, Dave Benware wrote:
> >The line system "dir foo.txt"; returned "Bad command or file name".
> >
> >foo.txt does exist and I can run dir foo.txt within a dos box just
> >fine. Interestingly to me, system "dir"; worked okay. I guess it
> >just wo
| sub add_module
| {
| my($tempposition,$name,@variables) = @_;
| my $mdl_output;
| do "$name.mdl";
| if ($mdl_output=&ModulAdd(@variables))
| {
|
$html_write{$tempposition}="$html_write{$tempposition}$mdl_output";
| }
| undef &ModulAdd;
| my $length=length($mdl_output);
| }
Indentation
At 11:35 AM 1/31/02 -0500, Dave Benware wrote:
>The line system "dir foo.txt"; returned "Bad command or file name".
>
>foo.txt does exist and I can run dir foo.txt within a dos box just
>fine. Interestingly to me, system "dir"; worked okay. I guess it
>just won't take an argument.
>
>So, have I
Supposedly there's a module out there called Spreadsheet::WriteExcel, but I
haven't tried it yet. That might also be worth a look.
-Original Message-
From: Lance Prais
To: John Edwards; PERL
Sent: 1/31/02 9:57 AM
Subject: RE: Writing to a file
I am working on a Solaris box. So I will
On Jan 31, Rambog said:
>I am attempting a program that reads a list of numbers from the screen until
>the number 999 is read. It then prints the sum of all numbers read- with
>the exception of the 999.
>
>My code looks like:
>
>until ($number=999) {
You want ==, not = here.
>print "Please inp
Change
until ($number=999) {
and
if ($number=999) {
to == 999. You are assigning the value 999 to the $number var in both cases,
not checking if it is equal to 999.
Simple mistake, we've all made it ;)
HTH
John
P.S Here is how I would code this script.
use strict;
my ($number, $total);
Running the script (below) from Bob Showalter brought a problem to
surface on this win98se using ActivePerl 560 build 630.
The line system "dir foo.txt"; returned "Bad command or file name".
foo.txt does exist and I can run dir foo.txt within a dos box just
fine. Interestingly to me, system
You are using the assignment operator in your "until" and "if" blocks, and
*not* the comparison operator. You need to use the double equals for what
you want...
until ($number == 999)
And
if ($number == 999)
Rob
-Original Message-
From: Rambog [mailto:[EMAIL PROTECTED]]
Sent: Thursd
At 11:09 AM 1/31/2002 -0500, you wrote:
>I am attempting a program that reads a list of numbers from the screen until
>the number 999 is read. It then prints the sum of all numbers read- with
>the exception of the 999.
>
>My code looks like:
>
>until ($number=999) {
>print "Please input your numb
A couple of things here ...
1) Watch out for = vs. == ... very tricky! Your first until loop won't even
eval b/c $number=999 is always true.
2) @a=$number; is not what you want... I'm not even sure what that does. You
probably want to use the push function, like so:
push @a, $number
There is a great article you can read about using
Spreadsheet::WriteExcel and Spreadsheet::ParseExcel modules.
It can be found here:
http://www-106.ibm.com/developerworks/linux/library/l-pexcel/
HTH!
>>> "Lance Prais" <[EMAIL PROTECTED]> 01/31/02 12:45PM >>>
I have a question regarding writing
--- Jan Gruber <[EMAIL PROTECTED]> wrote:
> Hi !
>
> Sorry for the previous posting, im not yet completely awake ;o)
>
> > > >How can the param's be placed into a new hash?
> > >
> > > CGI.pm has a Vars() method, I believe, which returns a hash.
> > >
> > > use CGI;
> > > my $q = CGI->new;
Oops - split cannot take "?" as its first parameter - I apologize ... go w/
the /\?/ approach. :)
Jason
If memory serves me right, on Thursday 31 January 2002 11:15, Jason Purdy
wrote:
> The //'s around the ? treat the first paramater of the split() function as
> a regular expression, which tr
I am attempting a program that reads a list of numbers from the screen until
the number 999 is read. It then prints the sum of all numbers read- with
the exception of the 999.
My code looks like:
until ($number=999) {
print "Please input your number:\n";
chomp($number=);
@a=$number;
}
foreach $
The //'s around the ? treat the first paramater of the split() function as a
regular expression, which treats the question mark as a special character
(saying to match the preceding char(s) zero or one time). If you're trying
to split $testdata with an actual question mark, try using quotes in
? is a special charater (a quantifier like * or {6} )
it quantifies to 0 or 1;
it's also a modifier to a quantifier causing it to match the least of the
quantifier.
Just put a \ in front of it
split(/\?/,$testdata);
-Original Message-
From: Darren Simpson [mailto:[EMAIL PROTECTED]]
Sen
> So you can see that the string is 4 bytes long. When I write it to the file,
> the file becomes 5 bytes, because the LF is converted to a CR/LF pair. When
> I read it back in, the reverse conversion is made, so the string becomes 4
> bytes again. When I call binmode, that conversion is not
The question mark is a special character in a regular expression meaning
"zero or one" and *must* follow a character or character class.
If you want to split on the question mark character you need to escape it so
that it no longer has special meaning. Like this:
split(/\?/,$testdata);
Rob
--
I got the same results using ActiveState on NT 4.0 but
cyqwin gives me:
length is 4
-rw-r--r--1 dennis None5 Jan 31 10:02 foo.txt
length is 5
length is 5
I will leave the analysis to someone more qualified than I!
Good Luck!
Dennis
--
To unsu
>
> Reversing the hash is more work than it's worth, as you've found out.
Certainly true and here is my mea culpa :))-
It just did not occur to me about the,
@keys = sort { $hash{$b} <=> $hash{$a} } keys %hash;
statement. Thanks Japhy and Nikola.
- Rex
hi. i keep getting wierd errors when i try to split a string. the string
is
split(/?/,$testdata);
the error i get is
/?/: ?+* follows nothing in regexp
what does it mean
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Jan 31, [EMAIL PROTECTED] said:
>I have a simple hash with directory names as keys and sizes as values. I
>would like to print the hash, in descending order of the size of each
>directory.
# this sorts your keys based on their values, descending
@keys = sort { $hash{$b} <=> $hash{$a} } ke
I am working on a Solaris box. So I will try the winExcel, hopefully that
will solve this.
Thank You
Lance
-Original Message-
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 7:50 AM
To: 'Lance Prais'; PERL
Subject: RE: Writing to a file
What OS are you
What OS are you running? I've included a script that uses Win32::OLE to
interface with Excel. You'll need to be on a Win32 machine, with Excel
installed.
There is also a module called Spreadsheet::WriteExcel which is platform
independant, but I have not had any experience using this.
HTH
John
You can also use Nedit www.nedit.org if your not a big emacs fan.
-Original Message-
From: Gary [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 10:47 AM
To: Booher Timothy B 1stLt AFRL/MNAC
Cc: [EMAIL PROTECTED]
Subject: Re: text to html converter
I am going to break one of
I have a simple hash with directory names as keys and sizes as values. I
would like to print the hash, in descending order of the size of each
directory.
I was contemplating of "reversing" the hash(so that sizes become keys and
directory names become values) and then do a sort on the keys. Howeve
Hi,
I am trying to write a perl5 script on Redhat that will use the ssh module
and pass various commands to various servers. I am trying to run multiple
commands using ssh2 and run commands as root. I am unable to log in
directly as root and need to use the "su -" command. However, I reciev
I have a question regarding writing to a file.
I have written a script and my experiences in perl thus far has been limited
to outputting data to a JSP page but in this case I need to send it to a
excel file. Does anyone know if there are examples out there that can show
me how to do this?
Than
I am going to break one of my rules and suggest a non-perl solution. There
probably is a way to do this in perl however if I understand your requirement
correctly you can use a good text editor instead. There are text editors out
there that do syntax highlighting -- they will make comments, rese
> -Original Message-
> From: KAVANAGH, Michael [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 31, 2002 9:06 AM
> To: '[EMAIL PROTECTED]'
> Subject: html entity conversion... one liner?
>
>
> I thought it would be good to be able to do this:
>
> $item = "";
> $item =~ tr/<>/(<)(>)
Hello - when printing out a lot of my c++ code I go from a nice color
syntaxed environment to a plain old black and white.
If there isn't already something else out there I would like to write a Perl
script that changes all comments to green for example and preserves the tab
spacing into the htm
On Thu, 2002-01-31 at 09:39, John Edwards wrote:
> Why *must* it be a one liner. I think my suggestion is easier to understand
> for someone having to maintain your code. If there is no other reason than
> "I want a one liner" to do this on one line, then why not do it on two??
> Just because it i
On Jan 31, Gary Hawkins said:
>> >> for $field (param()) {
>> >> print "$field => ", param($field), "\n";
>> >> }
>> >
>> >How can the param's be placed into a new hash?
>>
>> CGI.pm has a Vars() method, I believe, which returns a hash.
>>
>> use CGI;
>> my $q = CGI->new;
>> $data =
Michael Kavanagh wrote:
>
> I thought it would be good to be able to do this:
>
> $item = "";
> $item =~ tr/<>/(<)(>)/;
tr/// will translate the '<' to a '(' and the '>' to a '&'.
> to convert those <> symbols to their entity references.
> however, the tr operator doesn't seem to like using (
Why *must* it be a one liner. I think my suggestion is easier to understand
for someone having to maintain your code. If there is no other reason than
"I want a one liner" to do this on one line, then why not do it on two??
Just because it is possible in one line, doesn't mean it's the best
approa
I believe that is not possible. A server side script can't launch a
client's browser.
Alan C. wrote:
> Hi,
>
> Win 2k with MSIE web browser
>
> Whether or not my web browser is already been launched/opened
>
> Can a Perl script do that task? Or a perl module?
>
> Able to do without bringin
If the file is fixed in this format, then you could do a check for
)
and write the line after that is found. Then continue with the file. For
example
open IN, "c:/input.txt" || die "Can't open c:/input.txt: $!";
open OUT, ">c:/new.txt" || die "Can't create c:/new.txt: $!";
while () {
On Thu, 31 Jan 2002 14:06:06 -, Michael Kavanagh
<[EMAIL PROTECTED]> wrote:
> I thought it would be good to be able to do this:
>
> $item = "";
> $item =~ tr/<>/(<)(>)/;
>
> to convert those <> symbols to their entity references. however, the
> tr operator doesn't seem to like using () to g
On Thu, 2002-01-31 at 09:06, KAVANAGH, Michael wrote:
> I thought it would be good to be able to do this:
>
> $item = "";
> $item =~ tr/<>/(<)(>)/;
>
> to convert those <> symbols to their entity references.
> however, the tr operator doesn't seem to like using () to group... any
> comments on
I have a file whose contents are of the form :
NET_A OUTPUT (
REQUIRED (
_UP %0.093 BR CLK
_DN %0.093 BR CLK
)
)
NET_B OUTPUT (
REQUIRED (
_UP %0.093 BR CLK
_DN %0.093 BR CLK
)
)
I would like to read in this file in and modify the
contents to be as follows :
$item =~ s//>/g;
Well. It is on one line ;)
John
-Original Message-
From: KAVANAGH, Michael [mailto:[EMAIL PROTECTED]]
Sent: 31 January 2002 14:06
To: '[EMAIL PROTECTED]'
Subject: html entity conversion... one liner?
I thought it would be good to be able to do this:
$item = "";
$ite
> -Original Message-
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 31, 2002 9:02 AM
> To: 'Dave Benware'; Beginners perl
> Subject: RE: What is the newline character (\n) equal to?
>
>
> > -Original Message-
> > From: Dave Benware [mailto:[EMAIL PROTE
I thought it would be good to be able to do this:
$item = "";
$item =~ tr/<>/(<)(>)/;
to convert those <> symbols to their entity references.
however, the tr operator doesn't seem to like using () to group... any
comments on how to make this operation in to a one-liner?
Thanks
Mike
--
To u
> -Original Message-
> From: Dave Benware [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 31, 2002 8:51 AM
> To: Beginners perl
> Subject: Re: What is the newline character (\n) equal to?
>
>
> Dave Benware wrote:
> > CR/LF has never been translated to a LF while reading a file
> >
ISSUES
Newlines
In most operating systems, lines in files are terminated
by newlines. Just what is used as a newline may vary from
OS to OS. Unix traditionally uses `\012', one type of
DOSish I/O uses `\015\012', and Mac OS uses `\015'.
Perl uses `\n' to represent the "logical" newline, where
Dave Benware wrote:
> CR/LF has never been translated to a LF while reading a file
> for me. If that were true, the whole situation would be
> transparent and I would have never asked the question it seems.
> I didn't see anything about this "translating" in the docs
> on the binmode function.
>
1 - 100 of 117 matches
Mail list logo