This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Ron, > To: address@hidden > From: Ron Kahn <address@hidden> > Subject: trouble modifying global attributes from NetCDFPerl interface. > Organization: System Development Division > Keywords: 200008141705.e7EH5NN04980 The above message contained the following: > I am trying to change the value of a global > attribute and when I execute the following code, > > $ncid = NetCDF::open("$filename",NetCDF::WRITE); > $status = > NetCDF::put_att_text($ncid,NetCDF::GLOBAL,"channel",NetCDF::CHAR, > > > length($channel),\$channel); > > > I get the following message: > > Can't locate auto/NetCDF/put_att_tex.al in @INC at > test.pl line 114 > Carp::croak called at > /usr/local/perl5/lib/AutoLoader.pm line 93 > AutoLoader::AUTOLOAD called at test.pl > line 114 > main::write_GMS_data called at test.pl > line 88 > > > Is this an installation problem, or am I doing > something incorrectly. I have been able in the > past to read netCDf files without any problem, but > this is the first time I am trying to modify their > contents. BTW, the variables $filename and > $channel are > initialized and contain appropriate values. The netCDFPerl module uses version 2 of the the netCDF API rather than version 3; consequently, it supports the NetCDF::attput() method rather than the NetCDF::put_att_text() method. For a description of the netCDFPerl package and the netCDF version 2 interface, please see http://www.unidata.ucar.edu/packages/netcdf-perl/ Regards, Steve Emmerson <http://www.unidata.ucar.edu>