[GRASS-dev] Grass Variables/ Perl

Jachym Cepicky jachym.cepicky at centrum.cz
Thu Aug 3 03:53:57 EDT 2006


Hi Peter,

%ENV gives you the environment variables,

if ($ENV{GISBASE}){
    &main();
}
else {
    print "You have to run GRASS first!"
}

you can also read from stdin:

@region = `g.region -g`

jachym

On Thu, Aug 03, 2006 at 09:44:53AM +0200, peter.loewe at gmx.de wrote:
> When running a Perl-script from the grass-shell, grass commands can be started via backticks or using "system()". However, this is not suitable to set variables such as GRASS_HEIGHT/WIDTH etc (Scoping).
> 
> Has anybody tackled this issue before ?
> 
> 
> -- 
> Dr. Peter Löwe
> 
> Diplom-Geograph
> 
> <loewe at geomancers.net>
> <peter.loewe at gmx.de>
> 
> 
> 
> 
> 
> "Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
> 
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev

-- 
Jachym Cepicky
e-mail: jachym.cepicky at centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------   
OFFICE:                                     
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky at gdf-hannover.de
URL:    http://gdf-hannover.de
Tel.:   +49 511-39088507
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060803/41994465/attachment.bin


More information about the grass-dev mailing list