in reply to Win32::GUI Addlabel truncate problem

The truncate parameter only works when the label rectangle is too small for it's containing text. This is easily demonstrated in Win32::GUI::XMLBuilder: -
<GUI> <Window name='W1' dim='100, 100, 200, 80' title='truncate test' > <Label text='c:\some\path\notreal.txt' dim='20, $self->{W1}->Height-70, 70, 20' truncate="path" /> </Window> </GUI>
Using a -truncate of 'path' preserves as much as possible of the text after the last backslash. As an alternative solution you might use the File::Basename module: -
use File::Basename; use strict; use warnings; print dirname('c:\some\path\notreal.txt');