Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chaining multiple commands in a perl 'open' call #1017

Closed
p5pRT opened this issue Jan 9, 2000 · 2 comments
Closed

chaining multiple commands in a perl 'open' call #1017

p5pRT opened this issue Jan 9, 2000 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 9, 2000

Migrated from rt.perl.org#1968 (status was 'resolved')

Searchable as RT1968$

@p5pRT
Copy link
Author

p5pRT commented Jan 9, 2000

From sysmwd@detir.qld.gov.au

for some reason you can not chain multiple commands inside an 'open' sub
routine call ... the second 'open' call is the one you're interested in.

details​:

OS - Solaris 2.7
Compiler - cc​: WorkShop Compilers 5.0 98/12/15 C 5.0
Perl - 5.005_03

Apache/CGI enviroment

  - Apache/1.3.9 (Unix) mod_perl/1.21 mod_ssl/2.4.8 OpenSSL/0.9.4

ok this DOES NOT work


  my $tmpfile = "/tmp/mailer-input-$$";
  my $mailer = "/usr/lib/sendmail -t";

  open(MAILER_INPUT, ">$tmpfile") || warn;

  print MAILER_INPUT <<"EOF";
From​: scum@​scum.coma
Return-Path​: scum@​scum.coma
Reply-To​: scum@​scum.coma
To​: youraddress@​where.coma
Subject​: subject line goes here

and here is the user message

EOF

  close(MAILER_INPUT);

  open(MAILER, "$mailer < $tmpfile|") || warn;
  while(<MAILER>) { print $_; }
  close(MAILER);


and this DOES work


  my $mailer = "/usr/lib/sendmail -t";

  print MAILER_INPUT <<"EOF";
From​: scum@​scum.coma
Return-Path​: scum@​scum.coma
Reply-To​: scum@​scum.coma
To​: youraddress@​where.coma
Subject​: subject line goes here

and here is the user message

EOF

  open(MAILER, "|$mailer") || warn;
  print MAILER $allmsg;
  close(MAILER);


what is it so?? buggered if I know what the problem is and it ainst
anything to do with a glass and a half of full cream dairy milk

this is actually the second script I've had to fix up. The first was the
script that inserted stuff into the fulcrum search engine. So if things
start magically not working in perl check out your scripts. This is only
apparent on spider and it only started happening in the last six weeks or
so. I installed the current installation of perl in November, so it could
have been broken since back then. The only thing really different is that
I've compiled most of the stuff on spider with SparcWorks 5.0 and
everything was definately working before then...

--
Michael.Dean@​detir.qld.gov.au ,-_|\ UNIX Support
  / * Dept of Employment, Training
  Phone​: +61 7 3247 5724 \_,-._/ and Industrial Relations
  Fax​: +61 7 3247 9111 v http​://www.detir.qld.gov.au/

  "It's funny how, money allows, all to browse and be endowed"
  -- Foo Fighters

@p5pRT p5pRT closed this as completed Jul 13, 2003
@p5pRT
Copy link
Author

p5pRT commented Jul 13, 2003

@cwest - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant