I haven't used it in a while, but here is some code I used to use with
Win32::SerialPort. It may give you an idea of what you can do. This is
not very efficient code, but it works.
In my case there wasn't a whole lot of data coming through, so I just
opened the file each time I needed to write t
Harry Putnam <[EMAIL PROTECTED]> writes:
> Note that the original example from perldoc IO::Tee
> has no opens in it:
>
> use IO::Tee;
>
>$tee = IO::Tee->new($handle1, $handle2);
>print $tee "foo", "bar";
>my $input = <$tee>;
>
>
Haa, I dug it up o
Harry Putnam <[EMAIL PROTECTED]> writes:
> cat io.pl
> #!/usr/local/bin/perl -w
>
> use IO::Tee;
>
> open($handle1, "file1") or die("No!");
> open($handle2, "echo") or die("No2!");
>
> $tee = IO::Tee->new($handle1, $handle2);
>
> print $tee "Hello world!";
Note that the or
Tor Hildrum <[EMAIL PROTECTED]> writes:
> #!/usr/bin/perl
> use IO::Tee;
>
> open($handle1, "file1") or die("No!");
> open($handle2, "echo") or die("No2!");
>
> $tee = IO::Tee->new($handle1, $handle2);
> print $tee "Hello world!";
Well thats better than what I came up with but it dies here on the
On Sun, 12 Dec 2004 19:32:53 -0600, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Yeah, probably something like that but what else needs to be in there
> to make the example work?
Wild guess:
#!/usr/bin/perl
use IO::Tee;
open($handle1, "file1") or die("No!");
open($handle2, "echo") or die("No2
Tor Hildrum <[EMAIL PROTECTED]> writes:
> I have never used this module before in my life, but are you sure
> $handle1 and $handle2 aren't supposed to be refs to actual
> File-Handles?
Yeah, probably something like that but what else needs to be in there
to make the example work?
Running it just
On Sun, 12 Dec 2004 15:33:44 -0600, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Trying to see something of how it works:
>
> #!/usr/local/bin/perl -w
> use IO::Tee;
> my ($handle1, $handle2);
> $handle1 = "./one"
> $handle2 = "./two"
> $tee = IO::Tee->new($handle1, $handle2);
I have never use
[EMAIL PROTECTED] writes:
> Scott Dial <[EMAIL PROTECTED]> writes:
>
>> Try:
>> http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm
>
>>> ===
>>> Something I've wanted a few times was a way to write to two places at
>>> once or really I mean with one print call.
>>>
>>> Something like:
>>> print
Scott Dial <[EMAIL PROTECTED]> writes:
> Try:
> http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm
>> ===
>> Something I've wanted a few times was a way to write to two places at
>> once or really I mean with one print call.
>>
>> Something like:
>> print FILE1 FILE2 "something\n";
>> or
>>
Try:
http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm
-smd
+++ Harry Putnam [12/12/04 14:02 -0600]:
> Duplication alert: I hope this isn't a duplicate but I think something
> strange happened to my first try
>
> ===
> Something I've wanted a few times was a way to write to two places at
> once
Ron Goral wrote:
Thanks again for the replies. I contacted my host and the shared
SSL does indeed operate under its own name which is different from
mine. It is possible to create files under such circumstances, but
they must be created in a folder that is 0777. I'm not crazy about
having a fold
> -Original Message-
> From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 8:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Write to file with shared server certificate
>
>
> Ron Goral wrote:
> > If I try to create the file usi
Ron Goral wrote:
If I try to create the file using open(LOG,"+>>$logfile), the error
is:
No such file or directory at
/usr/wwws/htdocs/mydomain/cgi-bin/test.cgi line 35.
You must not include the '+' character when creating a file.
perldoc perlopentut
Try:
open LOG, ">> $logfile" or die $!;
> -Original Message-
> From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 3:25 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Write to file with shared server certificate
>
>
> Ron Goral wrote:
> > chmod 0666 is the right thing.
Ron Goral wrote:
chmod 0666 is the right thing. Thank you. However, I am not able
to do that programmatically when the script is running in secure
mode. The following dies:
$file_path = qq[/usr/wwws/htdocs/mydomain/cgi-bin/logs/errs.log];
chmod 0666,$file_path or die "Cannot chmod $file_path - $!
> -Original Message-
> From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 9:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Write to file with shared server certificate
>
>
> Ron Goral wrote:
> > I need to write to a log file to re
Ron Goral wrote:
I need to write to a log file to record things happening in a cgi
script. The environment is secured using a server-wide, shared
certificate. I cannot write to the file and get an error telling
me I do not have the proper permissions to do so.
So, why don't you change the file per
open FILEHANDLE, "> output.txt" or die "$!";
print FILEHANDLE "Some text\n";
print FILEHANDLE "Some more text\n";
close FILEHANDLE;
Dylan
-Original Message-
From: Thomas Browner [mailto:[EMAIL PROTECTED]]
Sent: January 17, 2003 10:22 AM
To: [EMAIL PROTECTED]
Subject: write to file
Ho
open(OUT, "> test.txt") || die;
print OUT "This is a test...\n";
print OUT "More text...\n";
close(OUT);
On Fri, 2003-01-17 at 08:26, [EMAIL PROTECTED] wrote:
> How can I write to a file in perl.
>
> Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL P
> How can I write to a file in perl.
perldoc -f open
open(FILEHANDLE, ">$path_to_file") or die $@;
print FILEHANDLE $newfilecontents;
close(FILEHANDLE);
> writes over
>> appends
< reads
open...
@lines_in)file = ;
close...
Dan
>
> Thomas
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED
20 matches
Mail list logo