On 06/03/2012 04:47, lina wrote:
On Tue, Mar 6, 2012 at 12:23 PM, Rob Dixon<rob.di...@gmx.com> wrote:
Lina the code you have shown doesn't produce that warning. If you still
need help then please post your current code.
Thank you. it's weird.
#!/usr/bin/env perl
use strict;
use warnings;
use File::Spec;
use File::Basename;
my $INPUTFILE = $ARGV[0];
my $tex_filename = $INPUTFILE;
my $bib_filename = "/home/lina/texmf/bibtex/bib/biophymd.bib";
my $bib_abbrev_filename = "/home/lina/texmf/bibtex/bib/biophyabbrev.bib";
# divide the input file name into its path and name,
# ignore its extension
my ($name, $path) = fileparse($tex_filename, qr/\.[^\.]+$/);
# create a new name with .bib extension
my $output_bib_filename = File::Spec->catfile($path,"$name.bib");
# Read bib_abbrevation file
open my $bib_output, '<', $bib_abbrev_filename;
open $bib_output, '>', $output_bib_filename
or die "Could not write $output_bib_filename:$!\n";
####### Here I don't know why the try.bib is empty.
####### I upload the relevant file in below link,
https://docs.google.com/open?id=0B93SVRfpVVg3NXl6dVdZemdTb2VDaFhlbUs2Uk16dw
https://docs.google.com/open?id=0B93SVRfpVVg3M245NDl0QTlRRHFhU2lCUFQ4b3lMQQ
I'm not sure what you'e expecting here. Just opening a file doesn't read
from it, so after
open my $bib_output, '<', $bib_abbrev_filename;
you have opened biophymd.bib for input but not used the file handle. So
open $bib_output, '>', $output_bib_filename;
just closes the file handle and reopens it for output to the bib file
you specified on the command line.
Are you intending to copy from biophymd.bib to the output file? Please
explain.
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/